-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4434931
commit d8ec650
Showing
5 changed files
with
82 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,46 @@ | ||
(function($) { | ||
$.fn.lifestream.feeds.facebook_page = function( config, callback ) { | ||
|
||
var template = $.extend({}, | ||
{ | ||
wall_post: 'post on wall <a href="${link}">${title}</a>' | ||
}, | ||
config.template), | ||
|
||
/** | ||
* Parse the input from facebook | ||
*/ | ||
parseFBPage = function( input ) { | ||
var output = [], list, i = 0, j; | ||
|
||
if (input.rss && | ||
input.rss.channel && | ||
input.rss.channel[0] && | ||
input.rss.channel[0].item) { | ||
|
||
list = input.rss.channel[0].item; | ||
j = list.length; | ||
for( ; i<j; i++) { | ||
var item = list[i]; | ||
if( $.trim( item.title ) ){ | ||
output.push({ | ||
date: new Date(item.pubDate), | ||
config: config, | ||
html: $.tmpl( template.wall_post, item ) | ||
}); | ||
} | ||
"use strict"; | ||
|
||
$.fn.lifestream.feeds.facebook_page = function( config, callback ) { | ||
|
||
var template = $.extend({}, | ||
{ | ||
wall_post: 'posted <a href="${url}">${text}</a>' | ||
}, | ||
config.template); | ||
|
||
/** | ||
* Parse the input from facebook | ||
*/ | ||
var parseFacebooky = function(response) { | ||
var output = []; | ||
|
||
if (!response.posts || !response.posts.length) { | ||
return output; | ||
} | ||
} | ||
return output; | ||
}; | ||
|
||
$.ajax({ | ||
url: 'https://facebooky.herokuapp.com/' + config.user, | ||
success: function( data ) { | ||
callback(parseFBPage(data)); | ||
} | ||
}); | ||
|
||
// Expose the template. | ||
// We use this to check which templates are available | ||
return { | ||
"template" : template | ||
}; | ||
for (var i = 0 ;i < response.posts.length; i++){ | ||
var post = response.posts[i]; | ||
|
||
}; | ||
output.push({ | ||
"date": new Date(post.time * 1000), | ||
"config": config, | ||
"html": $.tmpl(template.wall_post, post) | ||
}); | ||
} | ||
callback(output); | ||
}; | ||
|
||
$.ajax({ | ||
url: 'https://facebooky.herokuapp.com/page/' + config.user, | ||
success: parseFacebooky | ||
}); | ||
|
||
// Expose the template. | ||
// We use this to check which templates are available | ||
return { | ||
"template" : template | ||
}; | ||
|
||
}; | ||
})(jQuery); |