Permalink
Browse files

v0.3.0 - RSS Support by @dineshcooper

  • Loading branch information...
1 parent 590da7c commit e8214e0326e98fb3b67f7f654fd734dd989b96ba @christianvuerings committed Jan 18, 2012
Showing with 62 additions and 11 deletions.
  1. +2 −0 README.md
  2. +1 −0 css/lifestream.css
  3. +1 −1 download/services.json
  4. +49 −1 jquery.lifestream.js
  5. +2 −2 jquery.lifestream.min.js
  6. +1 −1 src/core.js
  7. +6 −6 src/services/rss.js
View
@@ -41,6 +41,7 @@ Currently supports the following feeds:
* [Pinboard](http://pinboard.com)
* [Posterous](http://posterous.com)
* [Reddit](http://reddit.com)
+* [RSS](http://en.wikipedia.org/wiki/RSS)
* [Slideshare](http://slideshare.com)
* [Snipplr](http://snipplr.com)
* [Stackoverflow](http://stackoverflow.com)
@@ -256,6 +257,7 @@ Special thanks all the [committers](https://raw.github.com/christianv/jquery-lif
## Version log
+* 0.3.0 RSS support
* 0.2.9 Hypem support
* 0.2.8 Gimmebar support
* 0.2.7 Zotero support
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1 +1 @@
-["bitbucket","bitly","blogger","dailymotion","delicious","deviantart","digg","dribbble","facebook_page","flickr","foomark","formspring","forrst","foursquare","gimmebar","github","googleplus","googlereader","hypem","instapaper","iusethis","lastfm","librarything","mlkshk","picplz","pinboard","posterous","reddit","slideshare","snipplr","stackoverflow","tumblr","twitter","vimeo","wikipedia","wordpress","youtube","zotero"]
+["bitbucket","bitly","blogger","dailymotion","delicious","deviantart","digg","dribbble","facebook_page","flickr","foomark","formspring","forrst","foursquare","gimmebar","github","googleplus","googlereader","hypem","instapaper","iusethis","lastfm","librarything","mlkshk","picplz","pinboard","posterous","reddit","rss","slideshare","snipplr","stackoverflow","tumblr","twitter","vimeo","wikipedia","wordpress","youtube","zotero"]
View
@@ -1,6 +1,6 @@
/*!
* jQuery Lifestream Plug-in
- * @version 0.2.9
+ * @version 0.3.0
* Show a stream of your online activity
*
* Copyright 2011, Christian Vuerings - http://denbuzze.com
@@ -1663,6 +1663,54 @@ $.fn.lifestream.feeds.reddit = function( config, callback ) {
};
})(jQuery);
+(function($) {
+$.fn.lifestream.feeds.rss = function( config, callback ) {
+
+ var template = $.extend({},
+ {
+ posted: 'posted <a href="${link}">${title}</a>'
+ },
+ config.template),
+
+ /**
+ * Parse the input from rss feed
+ */
+ parseReader = function( input ) {
+ var output = [], list, i = 0, j;
+ if(input.query && input.query.count && input.query.count > 0) {
+ list = input.query.results.rss.channel.item;
+ j = list.length;
+ for( ; i<j; i++) {
+ var item = list[i];
+
+ output.push({
+ url: 'http://www.google.com/reader/shared' + config.user,
+ date: new Date( item.pubDate ),
+ config: config,
+ html: $.tmpl( template.posted, item )
+ });
+ }
+ }
+ return output;
+ };
+
+ $.ajax({
+ url: $.fn.lifestream.createYqlUrl('select * from xml where url="'
+ + config.user + '"'),
+ dataType: 'jsonp',
+ success: function( data ) {
+ callback(parseReader(data));
+ }
+ });
+
+ // Expose the template.
+ // We use this to check which templates are available
+ return {
+ "template" : template
+ };
+
+};
+})(jQuery);
(function($) {
$.fn.lifestream.feeds.slideshare = function( config, callback ) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,6 +1,6 @@
/*!
* jQuery Lifestream Plug-in
- * @version 0.2.9
+ * @version 0.3.0
* Show a stream of your online activity
*
* Copyright 2011, Christian Vuerings - http://denbuzze.com
View
@@ -12,32 +12,32 @@ $.fn.lifestream.feeds.rss = function( config, callback ) {
*/
parseReader = function( input ) {
var output = [], list, i = 0, j;
- if(input.query && input.query.count && input.query.count >0) {
+ if(input.query && input.query.count && input.query.count > 0) {
list = input.query.results.rss.channel.item;
j = list.length;
for( ; i<j; i++) {
var item = list[i];
-
+
output.push({
url: 'http://www.google.com/reader/shared' + config.user,
- date: new Date( item["pubDate"] ),
+ date: new Date( item.pubDate ),
config: config,
html: $.tmpl( template.posted, item )
});
}
}
return output;
};
-
+
$.ajax({
- url: $.fn.lifestream.createYqlUrl('select * from xml where url="'
+ url: $.fn.lifestream.createYqlUrl('select * from xml where url="'
+ config.user + '"'),
dataType: 'jsonp',
success: function( data ) {
callback(parseReader(data));
}
});
-
+
// Expose the template.
// We use this to check which templates are available
return {

0 comments on commit e8214e0

Please sign in to comment.