From f73fe11edca7d1929e9dcdcf991902037735a7fb Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 17 Oct 2012 22:39:50 -0700 Subject: [PATCH] news feed from Yahoo Pipes instead of Twitter The old JSONP endpoint has been shut down. Fortunately, Yahoo Pipes provides JSONP output! --- beets.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/beets.js b/beets.js index ce4761a05..9cddaa217 100644 --- a/beets.js +++ b/beets.js @@ -29,17 +29,25 @@ var MONTH_NAMES = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var urlre = /(http:\/\/([^ \/]+)(\/\S+)?)\b/g; function getNews() { - var twitterUser = 'b33ts'; - var url = 'http://twitter.com/statuses/user_timeline/'+twitterUser+'.json'; + var url = 'http://pipes.yahoo.com/pipes/pipe.run' + var args = { + _id: '6a14ac0e3884a3913d16bbc4d0811322', + _render: 'json', + _callback: 'jsonpCallback' + }; $.ajax({ url: url, + data: args, + type: 'GET', dataType: 'jsonp', + jsonpCallback: 'jsonpCallback', success: function(data) { // Find the first non-reply status. This assumes there's at least // one non-reply in this chunk... probably a reasonable assumption. $('#twitterStatus').empty(); var count = 0; - $.each(data, function(i, status) { + $.each(data['value']['items'], function(i, status) { + console.log(status); if (status.in_reply_to_screen_name == null) { // Not a reply.