Skip to content

Commit

Permalink
Merge remote branch 'numericr/Pinboard' into dailymotion
Browse files Browse the repository at this point in the history
* numericr/Pinboard:
  Added Pinboard support
  • Loading branch information
christianvuerings committed Jun 20, 2011
2 parents d8a134b + 500afd9 commit b957a04
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions css/lifestream.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions jquery.lifestream.js
Expand Up @@ -661,6 +661,41 @@

};

$.fn.lifestream.feeds.pinboard = function (obj, callback) {

var parsePinboard = function (input) {
var output = [], list, i = 0, j, item;

if (input.query && input.query.count && input.query.count > 0) {
list = input.query.results.RDF.item;
j = list.length;
for ( ; i < j; i++) {
item = list[i];

output.push({
date: new Date(item.date),
service: obj.service,
html: 'added bookmark <a href="' + item.link + '">'
+ item.title + '</a>'
});

}
}

return output;
};

$.ajax({
url: createYqlUrl('select * from xml where '
+ 'url="http://feeds.pinboard.in/rss/u:' + obj.user + '"'),
dataType: "jsonp",
success: function (data) {
callback(parsePinboard(data));
}
});

};

$.fn.lifestream.feeds.reddit = function(obj, callback){

/**
Expand Down

0 comments on commit b957a04

Please sign in to comment.