Permalink
Browse files

Miso support

This service requires the user ID, not the user name. This you can get
easy, by logging in, the viewing the source of a page. There should be
a meta tag, named 'user', e.g.:
`<meta name="user" content="226935" />`

(png optimization added to contribution guide since I regularly get
-10% off this way, on miso I reduced the filesize by 20%)
  • Loading branch information...
1 parent d332dc1 commit dacdd27a41f4f3bea6758d3f6ac73f2b0f7c63d1 @arminrosu arminrosu committed Oct 13, 2012
Showing with 53 additions and 2 deletions.
  1. +3 −2 README.md
  2. +1 −0 css/lifestream.css
  3. +49 −0 src/services/miso.js
View
@@ -183,8 +183,9 @@ Have a look at [this commit](https://github.com/christianv/jquery-lifestream/com
### Create data:URI for an icon
1. [Convert](http://converticon.com/) the favicon.ico of a site to a .png file. (e.g. http://google.com/favicon.ico)
-2. [Make](http://www.dopiaza.org/tools/datauri/) a data:URI for it.
-3. Put the data:URI in css/lifestream.css (alphabetical order).
+2. [Optimize](http://www.smushit.com/ysmush.it/) the .png file.
+3. [Make](http://www.dopiaza.org/tools/datauri/) a data:URI for it.
+4. Put the data:URI in css/lifestream.css (alphabetical order).
### How to commit?
View

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

Oops, something went wrong.
View
@@ -0,0 +1,49 @@
+(function($) {
+$.fn.lifestream.feeds.miso = function( config, callback ) {
+
+ var template = $.extend({},
+ {
+ watched: 'checked in to <a href="${link}">${title}</a>'
+ },
+ config.template),
+
+ /**
+ * Parse the input from rss feed
+ */
+ parseMiso = 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.gomiso.com/feeds/user/' + config.user
+ + '/checkins.rss',
+ date: new Date( item.pubDate ),
+ config: config,
+ html: $.tmpl( template.watched, item )
+ });
+ }
+ }
+ return output;
+ };
+
+ $.ajax({
+ url: $.fn.lifestream.createYqlUrl('select * from xml where url="'
+ + 'http://www.gomiso.com/feeds/user/' + config.user + '/checkins.rss"'),
+ dataType: 'jsonp',
+ success: function( data ) {
+ callback(parseMiso(data));
+ }
+ });
+
+ // Expose the template.
+ // We use this to check which templates are available
+ return {
+ "template" : template
+ };
+
+};
+})(jQuery);

0 comments on commit dacdd27

Please sign in to comment.