I have a Wednesday lecture coming up for my Ruby class that will conflict with the first game of the World Series. While I was sleeping off a virus this afternoon, I awoke thinking: I should have a feed showing the game status in the footer of my slides.
Well, it was really easy. I got a key for the Google Feed API, then wrote my code to get a feed updated into the slides footer. The code was just this:
google.load("feeds", "1");
function getRedSoxInfo() {
var feed = new google.feeds.Feed("http://twitter.com/statuses/friends\_timeline/3474891.rss");
feed.load(function(result) {
if (!result.error) {
var status = ""
for (var i = 0; i
Google says it can be up to an hour -- more frequent for certain feeds.
Obvously for a baseball game, you want the feed to be updated as soon as possible. For the class, I'd be using http://twitter.com/redsoxcast but to see how rapidly Google is getting updates from Twitter, I used the "With Others" feed for /redsoxcast -- these are twitters from friends of redsoxcast. You get a new one every few seconds.
But the Google Feed API just isn't keeping up.
So here's the product: An open source Feed API that provides for a simple feed reflector that would be run on one's own server. I'd write this myself if I had a bit more time. Indeed, this would be a nice add-on to the Google Feeds API: A bit of server-side code so that you could point the Google Feed API at your own server instead of at Google's. Your server would provide a non-cached dump from the feed.
comments powered by Disqus