Skip to content

Instantly share code, notes, and snippets.

@richardmackney
Created February 18, 2011 12:19
Show Gist options
  • Save richardmackney/833599 to your computer and use it in GitHub Desktop.
Save richardmackney/833599 to your computer and use it in GitHub Desktop.
Using jquery to display feed from Google reader
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var url = "http://www.google.com/reader/public/javascript/feed/http://www.google.com/reader/public/atom/user%2F01019311013388988458%2Fstate%2Fcom.google%2Fbroadcast?callback=?";
$.getJSON(url,
function(data) {
for(var i = 0; i < data.items.length && i < 5; i += 1)
$('.grJSON').append('<li>' + '<h4>' + '<a target="_blank" href="' + data.items[i].alternate.href + '">' + data.items[i].title + '</a>' + '</h4>' + '<br />');
$('.grJSON').wrapInner('<ul></ul>');
});
});
</script>
<div class="grJSON"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment