Skip to content

Commit

Permalink
Add support for the 'statuses/home_timeline' method, which shows the
Browse files Browse the repository at this point in the history
statuses of the user and his/her followers including retweets.

This complements the 'statuses/user_timeline' method which just shows the status of the user him/her self.
  • Loading branch information
mrvdb authored and elektronaut committed Dec 6, 2010
1 parent bb22cdb commit 4a1e7af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jquery.livetwitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
} else {
// Extend settings with the defaults
settings = $.extend({
mode: 'search', // Mode, valid options are: 'search', 'user_timeline'
mode: 'search', // Mode, valid options are: 'search', 'user_timeline', 'list', 'home_timeline'
rate: 15000, // Refresh rate in ms
limit: 10, // Limit number of results
imageSize: 24, // Size of image in pixels
Expand Down Expand Up @@ -147,11 +147,11 @@
url = "http://search.twitter.com/search.json?";
}
url += paramsString + "&callback=?";
} else if (twitter.mode === 'user_timeline') {
} else if (twitter.mode === 'user_timeline' || twitter.mode === 'home_timeline' ) {
if (settings.service.length > 0) {
url = "http://" + settings.service + "/api/statuses/user_timeline/" + encodeURIComponent(this.query) + ".json?count=" + twitter.limit + "&callback=?";
url = "http://" + settings.service + "/api/statuses/" + twitter.mode + "/" + encodeURIComponent(this.query) + ".json?count=" + twitter.limit + "&callback=?";
} else {
url = "http://api.twitter.com/1/statuses/user_timeline/" + encodeURIComponent(this.query) + ".json?count=" + twitter.limit + "&callback=?";
url = "http://api.twitter.com/1/statuses/" + twitter.mode + "/" + encodeURIComponent(this.query) + ".json?count=" + twitter.limit + "&callback=?";
}
} else if (twitter.mode === 'list') {
var username = encodeURIComponent(this.query.user);
Expand Down Expand Up @@ -290,4 +290,4 @@
});
return this;
};
})(jQuery);
})(jQuery);

0 comments on commit 4a1e7af

Please sign in to comment.