Skip to content

Instantly share code, notes, and snippets.

@cognitom
Created May 26, 2012 09:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cognitom/2793098 to your computer and use it in GitHub Desktop.
Save cognitom/2793098 to your computer and use it in GitHub Desktop.
Retrieve Facebook page feed from jQuery
$(function(){
var fbpage_id = 131130253626713;// change to your facebook page id.
var fbpage_feed = 'https://www.facebook.com/feeds/page.php?format=atom10&id=' + fbpage_id;
var feed_api = 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=' + encodeURIComponent(fbpage_feed);
$.getJSON(feed_api + '&callback=?', function(data){
$(data.responseData.feed.entries).each(function(index){
$('ul#update-feed').append($('<li />', {
'data-role': "list-divider"
}).append($('<a />', {
'href': this.link,
'data-transition': 'slide',
'html': this.contentSnippet
})));
});
//$('ul#update-feed').listview('refresh'); // for jQuery mobile
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment