Skip to content

Instantly share code, notes, and snippets.

@haxorjim
Created March 10, 2012 00:43
Show Gist options
  • Save haxorjim/2009480 to your computer and use it in GitHub Desktop.
Save haxorjim/2009480 to your computer and use it in GitHub Desktop.
Tiny RSS Reader
<html>
<head>
<title>Tiny RSS</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
var feeds = [];
google.load("feeds", "1");
function initialize() {
for (var i in feeds) {
renderFeed(feeds[i].url);
}
}
function renderFeed(url) {
var feed = new google.feeds.Feed(url);
feed.setNumEntries(100);
feed.load(function (result) {
if (!result.error) {
var container = document.getElementById("feed");
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var div = document.createElement("div");
div.innerHTML = '<table style="margin: 5px"><tr><td valign="top"><img src="http://www.google.com/s2/favicons?domain=' + result.feed.feedUrl.split('//')[1].split('/')[0] + '" style="padding-right: 4px; width: 16px; height: 16px;" /></td><td style="font-size: 13px; font-family: HelveticaNeue, \'Helvetica Neue\', Helvetica, Arial, sans-serif;"><strong>' + entry.title + '</strong>: ' + entry.contentSnippet + '<div style="padding-top: 3px"><a href = "' + entry.link + '">' + result.feed.title + '</a></div></td></tr></table><hr>';
container.appendChild(div);
}
}
});
}
feeds.push({ url: 'http://blog.mongohq.com/atom.xml' });
feeds.push({ url: 'http://www.planetnodejs.com/site.rss' });
feeds.push({ url: 'http://ajaxian.com/index.xml' });
feeds.push({ url: 'http://blog.cloudno.de/rss.xml' });
feeds.push({ url: 'http://code.google.com/feeds/p/d-framework/updates/basic' });
feeds.push({ url: 'http://feeds.feedburner.com/AirExamples' });
feeds.push({ url: 'http://feeds.feedburner.com/AtlassianBlog' });
feeds.push({ url: 'http://feeds.feedburner.com/dailyjs' });
feeds.push({ url: 'http://feeds.feedburner.com/extblog' });
feeds.push({ url: 'http://howtonode.org/feed.xml' });
feeds.push({ url: 'http://jquery.com/blog/feed/' });
feeds.push({ url: 'http://lifehacker.com/index.xml' });
feeds.push({ url: 'http://news.ycombinator.com/rss' });
feeds.push({ url: 'http://www.linuxjournal.com/node/feed' });
feeds.push({ url: 'http://www.osnews.com/files/recent.xml' });
feeds.push({ url: 'http://xkcd.com/rss.xml' });
google.setOnLoadCallback(initialize);
</script>
</head>
<body>
<div id="feed"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment