Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

0.1.0 - jQuery Templates support

Changes:
 - Add template.html - see current available templates
 - Load the jQuery template script within jQuery Lifestream (if it isn't loaded) - otherwise this broke previous scripts!
 - Contain the templates within the feeds themselves
 - Add README section about jQuery templates
  • Loading branch information...
commit b228391914a72d13dab60c02d782600b13298810 1 parent 5ff9ad8
@christianv authored
View
24 README.md
@@ -8,7 +8,7 @@ Check out [the example][example] or create [your own lifestream][melifestream] i
[![Follow us on twitter](http://f.cl.ly/items/2z1p0w320g1q0T061m1u/twitter_follow.png)](http://twitter.com/jq_lifestream)
## Requirements
-* [jQuery 1.3+](http://www.jquery.com)
+* [jQuery 1.4.2+](http://www.jquery.com)
## Supported feeds
@@ -97,6 +97,23 @@ For more information about each _service_, check out the [source code][exampleso
Adding in your own feed is pretty easy.
Have a look at [this commit](https://github.com/christianv/jquery-lifestream/commit/529a06db159b4123ee3b2cc604f3a3ed698c6e9a) which adds support for the last.fm feed.
+### jQuery Templates
+
+You have the ability to use jQuery templates for your feed.
+Checkout the [template page](http://christianv.github.com/jquery-lifestream/template.html) to see an overview of the current available templates.
+
+Usage:
+
+``` javascript
+{
+ service: 'deviantart',
+ user: 'gabbyd70',
+ template: {
+ deviationpost: 'heeft hetvolgende gepost: <a href="${url}">${title}</a>'
+ }
+}
+```
+
### 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)
@@ -136,8 +153,13 @@ Places on the web where this plug-in got mentioned:
* [ProgrammableWeb](http://www.programmableweb.com/mashup/jquery-lifestream) - Mashup of the Day on 17/06/2011
* [Softpedia](http://webscripts.softpedia.com/script/Modules/jQuery-Plugins/jQuery-Lifestream-68762.html) - Softpedia pick
+## Special Thanks
+
+Special thanks all the [committers](https://raw.github.com/christianv/jquery-lifestream/master/COMMITTERS) and [gabbyd70](http://gabbyd70.deviantart.com/) for letting us use her DeviantART username.
+
## Version log
+* 0.1.0 jQuery Template support
* 0.0.17 Forrst & PicPlz support
* 0.0.16 Iusethis support
* 0.0.15 Dailymotion & Pinboard support
View
71 example.html
@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
- <meta name="description" content="The jQuery Lifestream plug-in enables you to show a stream of your online activity. On this page you can check out the examples">
+ <meta name="description" content="The jQuery Lifestream plug-in enables you to show a stream of your online activity. On this page you can check out the examples">
<meta name="keywords" content="jQuery, plugin, lifestream, jquery-lifestream, twitter, delicious, github, stackoverflow, flickr, lastfm, youtube">
<title>jQuery Lifestream example</title>
@@ -65,15 +65,14 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script>!window.jQuery && document.write('<script src="http://code.jquery.com/jquery-1.6.1.min.js"><\/script>');</script>
- <script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
<script src="jquery.lifestream.js" type="text/javascript" charset="utf-8"></script>
<script>
$("#lifestream").lifestream({
limit: 400,
list:[
{
- service: "dailymotion",
- user: "VideojugTechnologyandCars"
+ service: 'dailymotion',
+ user: 'VideojugTechnologyandCars'
},
{
service: 'delicious',
@@ -95,72 +94,72 @@
}
},
{
- service: "dribbble",
- user: "flarup"
+ service: 'dribbble',
+ user: 'flarup'
},
// find your flickr id @
// http://www.flickr.com/services/api/explore/?method=flickr.people.findByUsername
{
- service: "flickr",
- user: "60378309@N02"
+ service: 'flickr',
+ user: '60378309@N02'
},
{
- service: "forrst",
- user: "thatryan"
+ service: 'forrst',
+ user: 'thatryan'
},
// Run javascript:alert(_USER_ID); when you're logged in at google reader
{
- service: "googlereader",
- user: "16243859758547797209"
+ service: 'googlereader',
+ user: '16243859758547797209'
},
{
- service: "github",
- user: "christianv"
+ service: 'github',
+ user: 'christianv'
},
{
- service: "iusethis",
- user: "marcus"
+ service: 'iusethis',
+ user: 'marcus'
},
{
- service: "lastfm",
- user: "denbuzze"
+ service: 'lastfm',
+ user: 'denbuzze'
},
{
- service: "picplz",
- user: "thatryan"
+ service: 'picplz',
+ user: 'thatryan'
},
{
- service: "pinboard",
- user: "mattandrews"
+ service: 'pinboard',
+ user: 'mattandrews'
},
{
- service: "reddit",
- user: "simongee"
+ service: 'reddit',
+ user: 'simongee'
},
{
- service: "slideshare",
- user: "denbuzze"
+ service: 'slideshare',
+ user: 'denbuzze'
},
// Run javascript:alert(userid); when you're logged in at stackoverflow
{
- service: "stackoverflow",
- user: "117193"
+ service: 'stackoverflow',
+ user: '117193'
},
{
- service: "tumblr",
- user: "hiromitz"
+ service: 'tumblr',
+ user: 'hiromitz'
},
{
- service: "twitter",
- user: "denbuzze"
+ service: 'twitter',
+ user: 'denbuzze'
},
{
- service: "vimeo",
- user: "denbuzze"
+ service: 'vimeo',
+ user: 'denbuzze'
},
{
- service: "youtube",
- user: "denbuzze"
+ service: 'youtube',
+ user: 'denbuzze'
}
]
});
View
2  index.html
@@ -45,7 +45,7 @@
<img border="0" width="90" src="http://github.com/images/modules/download/tar.png"></a>
</div>
- <h1><a href="http://github.com/christianv/jquery-lifestream">jquery-lifestream</a>
+ <h1><a href="http://github.com/christianv/jquery-lifestream">jQuery Lifestream</a>
<span class="small">by <a href="http://github.com/christianv">christianv</a></span></h1>
<div class="description">
View
58 jquery.lifestream-compiled.js
@@ -1,28 +1,30 @@
-(function(h){var l=function(f){return"http://query.yahooapis.com/v1/public/yql?q=__QUERY__&env=store://datatables.org/alltableswithkeys&format=json".replace("__QUERY__",encodeURIComponent(f))};h.fn.lifestream=function(f){var i=this,d=jQuery.extend({classname:"lifestream",limit:10},f),b={count:d.list.length,items:[]},a=jQuery.extend(true,{},d),e=function(c){h.merge(b.items,c);b.items.sort(function(k,m){return k.date>m.date?-1:k.date===m.date?0:1});c=h('<ul class="'+d.classname+'"/>');for(var g=b.items.length<
-d.limit?b.items.length:d.limit,j=0;j<g;j++)b.items[j].html&&c.append('<li class="'+d.classname+"-"+b.items[j].service+'">'+b.items[j].html+"</li>");i.html(c)};(function(){var c=0,g=d.list.length;for(delete a.list;c<g;c++){var j=d.list[c];if(h.fn.lifestream.feeds[j.service]&&h.isFunction(h.fn.lifestream.feeds[j.service])&&j.user){j._settings=a;h.fn.lifestream.feeds[j.service](j,e)}}})()};h.fn.lifestream.linkify=function(){var f=RegExp("(?:\\b[a-z\\d.-]+://[^<>\\s]+|\\b(?:(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)|(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5]))(?:[;/][^#?<>\\s]*)?(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?(?!\\w)|(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)|(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5]))(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?(?!\\w))",
-"ig"),i=/^[a-z\d.-]+:\/\//i,d={"'":"`",">":"<",")":"(","]":"[","}":"{","\u00bb":"\u00ab","\u203a":"\u2039"},b={callback:function(a,e){return e?'<a href="'+e+'" title="'+e+'">'+a+"</a>":a},punct_regexp:/(?:[!?.,:;'"]|(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(a,e){e=e||{};var c,g,j="",k=[],m,n,q,o,p;for(c in b)if(b.hasOwnProperty(c)&&e[c]===undefined)e[c]=b[c];for(;c=f.exec(a);){c=c[0];n=f.lastIndex;q=n-c.length;if(!/[\/:]/.test(a.charAt(q-1))){do{g=c;p=c.substr(-1);
-if(o=d[p]){o=c.match(RegExp("\\"+o+"(?!$)","g"));p=c.match(RegExp("\\"+p,"g"));if((o?o.length:0)<(p?p.length:0)){c=c.substr(0,c.length-1);n--}}if(e.punct_regexp)c=c.replace(e.punct_regexp,function(r){n-=r.length;return""})}while(c.length&&c!==g);g=c;i.test(g)||(g=(g.indexOf("@")!==-1?!g.indexOf("mailto:")?"":"mailto:":!g.indexOf("irc.")?"irc://":!g.indexOf("ftp.")?"ftp://":"http://")+g);if(m!=q){k.push([a.slice(m,q)]);m=n}k.push([c,g])}}k.push([a.substr(m)]);for(c=0;c<k.length;c++)j+=e.callback.apply(window,
-k[c]);return j||a}}();h.fn.lifestream.feeds=h.fn.lifestream.feeds||{};h.fn.lifestream.feeds.dailymotion=function(f,i){h.ajax({url:l('select * from xml where url="http://www.dailymotion.com/rss/user/'+f.user+'"'),dataType:"jsonp",success:function(d){var b=[],a=0,e,c;if(d.query&&d.query.count&&d.query.count>0&&d.query.results.rss.channel.item){d=d.query.results.rss.channel.item;for(e=d.length;a<e;a++){c=d[a];b.push({date:new Date(c.pubDate),service:f.service,html:'uploaded a video <a href="'+c.link+
-'">'+c.title+"</a>"})}}i(b)}})};h.fn.lifestream.feeds.delicious=function(f,i){var d=function(b){var a="";a+='added bookmark <a href="'+b.u+'">'+b.d+"</a>";return a};h.ajax({url:"http://feeds.delicious.com/v2/json/"+f.user,dataType:"jsonp",success:function(b){var a=[],e=0,c;if(b&&b.length&&b.length>0)for(c=b.length;e<c;e++){var g=b[e];a.push({date:new Date(g.dt),service:f.service,html:d(g)})}i(a)}})};h.fn.lifestream.feeds.deviantart=function(f,i){h.ajax({url:l('select title,link,pubDate from rss where url="http://backend.deviantart.com/rss.xml?q=gallery%3A'+
-encodeURIComponent(f.user)+'&type=deviation" | unique(field="title")'),dataType:"jsonp",success:function(d){var b=[],a,e=0,c;if(d.query&&d.query.count>0){d=d.query.results.item;for(c=d.length;e<c;++e){a=d[e];b.push({date:new Date(a.pubDate),service:f.service,html:'posted <a href="'+a.link+'">'+a.title+"</a>"})}}i(b)}})};h.fn.lifestream.feeds.dribbble=function(f,i){h.ajax({url:"http://api.dribbble.com/players/"+f.user+"/shots",dataType:"jsonp",success:function(d){var b=[],a=0,e;if(d&&d.total)for(e=
-d.shots.length;a<e;a++){var c=d.shots[a];b.push({date:new Date(c.created_at),service:f.service,html:'posted a shot <a href="'+c.url+'">'+c.title+"</a>"})}i(b)}})};h.fn.lifestream.feeds.flickr=function(f,i){h.ajax({url:"http://api.flickr.com/services/feeds/photos_public.gne?id="+f.user+"&lang=en-us&format=json",dataType:"jsonp",jsonp:"jsoncallback",success:function(d){var b=[],a=0,e;if(d&&d.items&&d.items.length>0)for(e=d.items.length;a<e;a++){var c=d.items[a];b.push({date:new Date(c.published),service:f.service,
-html:'posted a photo <a href="'+c.link+'">'+c.title+"</a>"})}i(b)}})};h.fn.lifestream.feeds.forrst=function(f,i){h.ajax({url:"http://forrst.com/api/v2/users/posts?username="+f.user+"",dataType:"jsonp",success:function(d){var b=[],a=0,e;if(d&&d.resp.length&&d.resp.length>0)for(e=d.resp.length;a<e;a++){var c=d.resp[a];b.push({date:new Date(c.created_at),service:f.service,html:"Posted a "+c.post_type+' titled <a href="'+c.post_url+'">'+c.title+"</a>"})}i(b)}})};h.fn.lifestream.feeds.foursquare=function(f,
-i){h.ajax({url:l('select * from rss where url="https://feeds.foursquare.com/history/'+f.user+'.rss"'),dataType:"jsonp",success:function(d){var b=[],a=0,e;if(d.query&&d.query.count&&d.query.count>0)for(e=d.query.count;a<e;a++){var c=d.query.results.item[a];b.push({date:new Date(c.pubDate),service:f.service,html:'checked in @ <a href="'+c.link+'">'+c.title+"</a>"})}i(b)}})};h.fn.lifestream.feeds.github=function(f,i){var d=function(a){return a.payload.repo||a.repository.owner+"/"+a.repository.name},
-b=function(a){var e="",c,g,j;if(a.type==="PushEvent"){c="";g=d(a);if(a.payload&&a.payload.shas&&a.payload.shas.json&&a.payload.shas.json[2])c=a.payload.shas.json[2]+" by "+a.payload.shas.json[3];e+='<a href="'+a.url+'" title="'+c+'">pushed</a> to <a href="http://github.com/'+g+'">'+g+"</a>"}else if(a.type==="GistEvent"){c=a.payload.desc||"";e+=a.payload.action+'d <a href="'+a.payload.url+'" title ="'+c+'">'+a.payload.name+"</a>"}else if(a.type==="CommitCommentEvent"||a.type==="IssueCommentEvent"){g=
-d(a);e+='<a href="'+a.url+'">commented</a> on <a href="http://github.com/'+g+'">'+g+"</a>"}else if(a.type==="PullRequestEvent"){g=a.payload.repo||a.repository.owner+"/"+a.repository.name;e+='<a href="'+a.url+'">'+a.payload.action+'</a> pull request on <a href="http://github.com/'+g+'">'+g+"</a>"}else if(a.type==="CreateEvent"&&(a.payload.ref_type==="tag"||a.payload.ref_type==="branch"||a.payload.object==="tag")){g=d(a);j=a.payload.ref_type||a.payload.object;c=a.payload.ref||a.payload.object_name;
-e+="created "+j+' <a href="'+a.url+'">'+c+'</a> for <a href="http://github.com/'+g+'">'+g+"</a>"}else if(a.type==="CreateEvent"){c=a.payload.object_name==="null"?a.payload.name:a.payload.object_name;e+="created "+a.payload.object+' <a href="'+a.url+'">'+c+"</a>"}else if(a.type==="DeleteEvent")e+="deleted "+a.payload.ref_type+' <a href="http://github.com/'+a.repository.owner+"/"+a.repository.name+'">'+a.payload.ref+"</a>";return e};h.ajax({url:l('select json.repository.owner,json.repository.name,json.payload,json.type,json.url, json.created_at from json where url="http://github.com/'+
-f.user+'.json"'),dataType:"jsonp",success:function(a){var e=[],c=0,g;if(a.query&&a.query.count&&a.query.count>0)for(g=a.query.count;c<g;c++){var j=a.query.results.json[c].json;e.push({date:new Date(j.created_at),service:f.service,html:b(j)})}i(e)}})};h.fn.lifestream.feeds.googlereader=function(f,i){h.ajax({url:l('select * from xml where url="www.google.com/reader/public/atom/user%2F'+f.user+'%2Fstate%2Fcom.google%2Fstarred"'),dataType:"jsonp",success:function(d){var b=[],a=0,e;if(d.query&&d.query.count&&
-d.query.count>0){d=d.query.results.feed.entry;for(e=d.length;a<e;a++){var c=d[a];b.push({date:new Date(parseInt(c["crawl-timestamp-msec"],10)),service:f.service,html:'starred post <a href="'+c.link.href+'">'+c.title.content+"</a>"})}}i(b)}})};h.fn.lifestream.feeds.iusethis=function(f,i){h.ajax({url:l('select * from xml where url="http://iphone.iusethis.com/user/feed.rss/'+f.user+'" or url="http://osx.iusethis.com/user/feed.rss/'+f.user+'" or url="http://win.iusethis.com/user/feed.rss/'+f.user+'"'),
-dataType:"jsonp",success:function(d){var b=[],a,e,c,g,j,k=0,m,n,q,o,p,r,s=["iPhone","OS X","Windows"];if(d.query&&d.query.count&&d.query.count>0&&d.query.results.rss){m=d.query.results.rss.length;o=["started using","stopped using","stopped loving","Downloaded","commented on","updated entry for","started loving","registered"];for(j=o.length;k<m;k++){r=s[k];a=d.query.results.rss[k].channel.item;e=0;for(c=a.length;e<c;e++){n=a[e];q=n.title.replace(f.user+" ","");for(g=0;g<j;g++)if(q.indexOf(o[g])>-1){p=
-o[g];break}g=q.split(p);b.push({date:new Date(n.pubDate),service:f.service,html:p.toLowerCase()+' <a href="'+n.link+'">'+g[1]+"</a> ("+r+")"})}}}i(b)}})};h.fn.lifestream.feeds.lastfm=function(f,i){var d=function(b){var a="";a+='loved <a href="'+b.url+'">'+b.name+'</a> by <a href="'+b.artist.url+'">'+b.artist.name+"</a>";return a};h.ajax({url:l('select * from xml where url="http://ws.audioscrobbler.com/2.0/user/'+f.user+'/lovedtracks.xml"'),dataType:"jsonp",success:function(b){var a=[],e=0,c;if(b.query&&
-b.query.count&&b.query.count>0&&b.query.results.lovedtracks&&b.query.results.lovedtracks.track){b=b.query.results.lovedtracks.track;for(c=b.length;e<c;e++){var g=b[e];a.push({date:new Date(parseInt(g.date.uts*1E3,10)),service:f.service,html:d(g)})}}i(a)}})};h.fn.lifestream.feeds.picplz=function(f,i){h.ajax({url:"http://picplz.com/api/v2/user.json?username="+f.user+"&include_pics=1",dataType:"jsonp",success:function(d){var b=[],a=0,e;if((e=d.value.users[0].pics)&&e.length&&e.length>0)for(d=e.length;a<
-d;a++){var c=e[a];b.push({date:new Date(c.date*1E3),service:f.service,html:'Uploaded <a href="'+c.pic_files["640r"].img_url+'">'+(c.caption||c.id)+"</a>"})}i(b)}})};h.fn.lifestream.feeds.pinboard=function(f,i){h.ajax({url:l('select * from xml where url="http://feeds.pinboard.in/rss/u:'+f.user+'"'),dataType:"jsonp",success:function(d){var b=[],a=0,e,c;if(d.query&&d.query.count&&d.query.count>0){d=d.query.results.RDF.item;for(e=d.length;a<e;a++){c=d[a];b.push({date:new Date(c.date),service:f.service,
-html:'added bookmark <a href="'+c.link+'">'+c.title+"</a>"})}}i(b)}})};h.fn.lifestream.feeds.reddit=function(f,i){var d=function(b){var a="",e="",c="http://www.reddit.com/r/"+b.data.subreddit,g=b.data.ups-b.data.downs;g=g>0?"+"+g:g;if(b.kind==="t1"){e="http://www.reddit.com/r/"+b.data.subreddit+"/comments/"+b.data.link_id.substring(3)+"/u/"+b.data.name.substring(3)+"?context=3";a+='<a href="'+e+'">commented ('+g+")</a> "}else if(b.kind==="t3")a+='<a href="http://www.reddit.com'+b.data.permalink+'">created new thread ('+
-g+")</a> ";a+=' in <a href="'+c+'">/r/'+b.data.subreddit+"</a>";return a};h.ajax({url:"http://www.reddit.com/user/"+f.user+".json",dataType:"jsonp",jsonp:"jsonp",success:function(b){var a=[],e=0,c;if(b&&b.data&&b.data.children&&b.data.children.length>0)for(c=b.data.children.length;e<c;e++){var g=b.data.children[e];a.push({date:new Date(g.data.created*1E3),service:f.service,html:d(g)})}i(a)}})};h.fn.lifestream.feeds.slideshare=function(f,i){h.ajax({url:l('select * from xml where url="http://www.slideshare.net/rss/user/'+
-f.user+'"'),dataType:"jsonp",success:function(d){var b=[],a=0,e,c;if(d.query&&d.query.count&&d.query.count>0){d=d.query.results.rss.channel.item;for(e=d.length;a<e;a++){c=d[a];b.push({date:new Date(c.pubDate),service:f.service,html:'uploaded a presentation <a href="'+c.link+'">'+c.title+"</a>"})}}i(b)}})};h.fn.lifestream.feeds.stackoverflow=function(f,i){var d=function(b){var a="",e="",c="",g="",j="http://stackoverflow.com/users/"+f.user;if(b.timeline_type==="badge"){e=b.timeline_type+" "+b.action+
-": "+b.description;c=b.detail;g=j+"?tab=reputation"}else if(b.timeline_type==="revision"||b.timeline_type==="comment"||b.timeline_type==="accepted"||b.timeline_type==="askoranswered"){e=b.post_type+" "+b.action;c=b.detail||b.description||"";g="http://stackoverflow.com/questions/"+b.post_id}a+='<a href="'+g+'" title="'+c+'">'+e+"</a> - "+c;return a};h.ajax({url:"http://api.stackoverflow.com/1.1/users/"+f.user+"/timeline?jsonp",dataType:"jsonp",jsonp:"jsonp",success:function(b){var a=[],e=0,c;if(b&&
-b.total&&b.total>0&&b.user_timelines)for(c=b.user_timelines.length;e<c;e++){var g=b.user_timelines[e];a.push({date:new Date(g.creation_date*1E3),service:f.service,html:d(g)})}i(a)}})};h.fn.lifestream.feeds.tumblr=function(f,i){var d=function(b,a){return{date:new Date(a.date),service:b.service,html:"posted a "+a.type+' <a href="'+a.url+'">'+(a["regular-title"]||a["quote-text"]||a["conversation-title"]||a["photo-caption"]||a["video-caption"]||a["audio-caption"]||a["regular-body"]||a["link-text"]||a.type||
-"").replace(/\<.+?\>/gi," ")+"</a>"}};h.ajax({url:l('select * from tumblr.posts where username="'+f.user+'"'),dataType:"jsonp",success:function(b){var a=[],e=0,c,g;if(b.query&&b.query.count&&b.query.count>0)if(h.isArray(b.query.results.posts.post))for(c=b.query.results.posts.post.length;e<c;e++){g=b.query.results.posts.post[e];a.push(d(f,g))}else h.isPlainObject(b.query.results.posts.post)&&a.push(d(f,b.query.results.posts.post));i(a)}})};h.fn.lifestream.feeds.twitter=function(f,i){var d=function(b){return h.fn.lifestream.linkify(b).replace(/ #([A-Za-z0-9\/\.]*)/g,
-function(a){return' <a target="_new" href="http://twitter.com/search?q='+a.replace(" #","%23")+'">'+a+"</a>"}).replace(/@[\w]+/g,function(a){return'<a href="http://www.twitter.com/'+a.replace("@","")+'">'+a+"</a>"})};h.ajax({url:l('select status.id, status.created_at, status.text from twitter.user.timeline where screen_name="'+f.user+'"'),dataType:"jsonp",success:function(b){var a=[],e=0,c;if(b.query&&b.query.count&&b.query.count>0)for(c=b.query.count;e<c;e++){var g=b.query.results.statuses[e].status;
-a.push({date:new Date(g.created_at),service:f.service,html:d(g.text)})}i(a)}})};h.fn.lifestream.feeds.vimeo=function(f,i){h.ajax({url:"http://vimeo.com/api/v2/"+f.user+"/videos.json",dataType:"jsonp",crossDomain:true,success:function(d){var b=[],a=0,e,c;if(d)for(e=d.length;a<e;a++){c=d[a];b.push({date:new Date(c.upload_date),service:f.service,html:'published a video <a href="'+c.url+'" title="'+c.description.replace(/"/g,"'").replace(/\<.+?\>/gi,"")+'">'+c.title+"</a>"})}i(b)}})};h.fn.lifestream.feeds.youtube=
-function(f,i){h.ajax({url:"http://gdata.youtube.com/feeds/api/users/"+f.user+"/favorites?v=2&alt=jsonc",dataType:"jsonp",success:function(d){var b=[],a=0,e,c;if(d.data&&d.data.items)for(e=d.data.items.length;a<e;a++){c=d.data.items[a];b.push({date:new Date(c.created),service:f.service,html:' favorited <a href="'+c.video.player["default"]+'" title="'+c.video.description+'">'+c.video.title+"</a>"})}i(b)}})}})(jQuery);
+(function(h){var m=function(f){return"http://query.yahooapis.com/v1/public/yql?q=__QUERY__&env=store://datatables.org/alltableswithkeys&format=json".replace("__QUERY__",encodeURIComponent(f))};h.fn.lifestream=function(f){var i=this,d=jQuery.extend({classname:"lifestream",limit:10},f),c={count:d.list.length,items:[]},a=jQuery.extend(true,{},d),e=function(b){h.merge(c.items,b);c.items.sort(function(l,n){return l.date>n.date?-1:l.date===n.date?0:1});b=c.items;for(var g=b.length<d.limit?b.length:d.limit,
+j=0,k,o=h('<ul class="'+d.classname+'"/>');j<g;++j){k=b[j];k.html&&h('<li class="'+d.classname+"-"+k.config.service+'">').append(k.html).appendTo(o)}i.html(o)};f=function(){var b=0,g=d.list.length;for(delete a.list;b<g;b++){var j=d.list[b];if(h.fn.lifestream.feeds[j.service]&&h.isFunction(h.fn.lifestream.feeds[j.service])&&j.user){j._settings=a;h.fn.lifestream.feeds[j.service](j,e)}}};jQuery.tmpl?f():jQuery.getScript("https://raw.github.com/jquery/jquery-tmpl/master/jquery.tmpl.min.js",f)};h.fn.lifestream.linkify=
+function(){var f=RegExp("(?:\\b[a-z\\d.-]+://[^<>\\s]+|\\b(?:(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)|(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5]))(?:[;/][^#?<>\\s]*)?(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?(?!\\w)|(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)|(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5]))(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?(?!\\w))",
+"ig"),i=/^[a-z\d.-]+:\/\//i,d={"'":"`",">":"<",")":"(","]":"[","}":"{","\u00bb":"\u00ab","\u203a":"\u2039"},c={callback:function(a,e){return e?'<a href="'+e+'" title="'+e+'">'+a+"</a>":a},punct_regexp:/(?:[!?.,:;'"]|(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(a,e){e=e||{};var b,g,j="",k=[],o,l,n,p,q;for(b in c)if(c.hasOwnProperty(b)&&e[b]===undefined)e[b]=c[b];for(;b=f.exec(a);){b=b[0];l=f.lastIndex;n=l-b.length;if(!/[\/:]/.test(a.charAt(n-1))){do{g=b;q=b.substr(-1);
+if(p=d[q]){p=b.match(RegExp("\\"+p+"(?!$)","g"));q=b.match(RegExp("\\"+q,"g"));if((p?p.length:0)<(q?q.length:0)){b=b.substr(0,b.length-1);l--}}if(e.punct_regexp)b=b.replace(e.punct_regexp,function(r){l-=r.length;return""})}while(b.length&&b!==g);g=b;i.test(g)||(g=(g.indexOf("@")!==-1?!g.indexOf("mailto:")?"":"mailto:":!g.indexOf("irc.")?"irc://":!g.indexOf("ftp.")?"ftp://":"http://")+g);if(o!=n){k.push([a.slice(o,n)]);o=l}k.push([b,g])}}k.push([a.substr(o)]);for(b=0;b<k.length;b++)j+=e.callback.apply(window,
+k[b]);return j||a}}();h.fn.lifestream.feeds=h.fn.lifestream.feeds||{};h.fn.lifestream.feeds.dailymotion=function(f,i){h.ajax({url:m('select * from xml where url="http://www.dailymotion.com/rss/user/'+f.user+'"'),dataType:"jsonp",success:function(d){var c=[],a=0,e,b;if(d.query&&d.query.count&&d.query.count>0&&d.query.results.rss.channel.item){d=d.query.results.rss.channel.item;for(e=d.length;a<e;a++){b=d[a];c.push({date:new Date(b.pubDate),config:f,html:'uploaded a video <a href="'+b.link+'">'+b.title+
+"</a>"})}}i(c)}})};h.fn.lifestream.feeds.delicious=function f(i,d){i.template=h.extend({},f.template,i.template);h.ajax({url:"http://feeds.delicious.com/v2/json/"+i.user,dataType:"jsonp",success:function(c){var a=[],e=0,b;if(c&&c.length&&c.length>0)for(b=c.length;e<b;e++){var g=c[e];a.push({date:new Date(g.dt),config:i,html:h.tmpl(i.template.bookmarkcreation,{url:g.u,title:g.d})})}d(a)}})};h.fn.lifestream.feeds.delicious.template={bookmarkcreation:'bookmarked <a href="${url}">${title}</a>'};h.fn.lifestream.feeds.deviantart=
+function f(i,d){i.template=h.extend({},f.template,i.template);h.ajax({url:m('select title,link,pubDate from rss where url="http://backend.deviantart.com/rss.xml?q=gallery%3A'+encodeURIComponent(i.user)+'&type=deviation" | unique(field="title")'),dataType:"jsonp",success:function(c){var a=[],e,b=0,g;if(c.query&&c.query.count>0){c=c.query.results.item;for(g=c.length;b<g;++b){e=c[b];a.push({date:new Date(e.pubDate),config:i,html:h.tmpl(i.template.deviationpost,{url:e.link,title:e.title})})}}d(a)}})};
+h.fn.lifestream.feeds.deviantart.template={deviationpost:'posted <a href="${url}">${title}</a>'};h.fn.lifestream.feeds.dribbble=function(f,i){h.ajax({url:"http://api.dribbble.com/players/"+f.user+"/shots",dataType:"jsonp",success:function(d){var c=[],a=0,e;if(d&&d.total)for(e=d.shots.length;a<e;a++){var b=d.shots[a];c.push({date:new Date(b.created_at),config:f,html:'posted a shot <a href="'+b.url+'">'+b.title+"</a>"})}i(c)}})};h.fn.lifestream.feeds.flickr=function(f,i){h.ajax({url:"http://api.flickr.com/services/feeds/photos_public.gne?id="+
+f.user+"&lang=en-us&format=json",dataType:"jsonp",jsonp:"jsoncallback",success:function(d){var c=[],a=0,e;if(d&&d.items&&d.items.length>0)for(e=d.items.length;a<e;a++){var b=d.items[a];c.push({date:new Date(b.published),config:f,html:'posted a photo <a href="'+b.link+'">'+b.title+"</a>"})}i(c)}})};h.fn.lifestream.feeds.forrst=function(f,i){h.ajax({url:"http://forrst.com/api/v2/users/posts?username="+f.user+"",dataType:"jsonp",success:function(d){var c=[],a=0,e;if(d&&d.resp.length&&d.resp.length>0)for(e=
+d.resp.length;a<e;a++){var b=d.resp[a];c.push({date:new Date(b.created_at),config:f,html:"Posted a "+b.post_type+' titled <a href="'+b.post_url+'">'+b.title+"</a>"})}i(c)}})};h.fn.lifestream.feeds.foursquare=function(f,i){h.ajax({url:m('select * from rss where url="https://feeds.foursquare.com/history/'+f.user+'.rss"'),dataType:"jsonp",success:function(d){var c=[],a=0,e;if(d.query&&d.query.count&&d.query.count>0)for(e=d.query.count;a<e;a++){var b=d.query.results.item[a];c.push({date:new Date(b.pubDate),
+config:f,html:'checked in @ <a href="'+b.link+'">'+b.title+"</a>"})}i(c)}})};h.fn.lifestream.feeds.github=function(f,i){var d=function(a){return a.payload.repo||a.repository.owner+"/"+a.repository.name},c=function(a){var e="",b,g,j;if(a.type==="PushEvent"){b="";g=d(a);if(a.payload&&a.payload.shas&&a.payload.shas.json&&a.payload.shas.json[2])b=a.payload.shas.json[2]+" by "+a.payload.shas.json[3];e+='<a href="'+a.url+'" title="'+b+'">pushed</a> to <a href="http://github.com/'+g+'">'+g+"</a>"}else if(a.type===
+"GistEvent"){b=a.payload.desc||"";e+=a.payload.action+'d <a href="'+a.payload.url+'" title ="'+b+'">'+a.payload.name+"</a>"}else if(a.type==="CommitCommentEvent"||a.type==="IssueCommentEvent"){g=d(a);e+='<a href="'+a.url+'">commented</a> on <a href="http://github.com/'+g+'">'+g+"</a>"}else if(a.type==="PullRequestEvent"){g=a.payload.repo||a.repository.owner+"/"+a.repository.name;e+='<a href="'+a.url+'">'+a.payload.action+'</a> pull request on <a href="http://github.com/'+g+'">'+g+"</a>"}else if(a.type===
+"CreateEvent"&&(a.payload.ref_type==="tag"||a.payload.ref_type==="branch"||a.payload.object==="tag")){g=d(a);j=a.payload.ref_type||a.payload.object;b=a.payload.ref||a.payload.object_name;e+="created "+j+' <a href="'+a.url+'">'+b+'</a> for <a href="http://github.com/'+g+'">'+g+"</a>"}else if(a.type==="CreateEvent"){b=a.payload.object_name==="null"?a.payload.name:a.payload.object_name;e+="created "+a.payload.object+' <a href="'+a.url+'">'+b+"</a>"}else if(a.type==="DeleteEvent")e+="deleted "+a.payload.ref_type+
+' <a href="http://github.com/'+a.repository.owner+"/"+a.repository.name+'">'+a.payload.ref+"</a>";return e};h.ajax({url:m('select json.repository.owner,json.repository.name,json.payload,json.type,json.url, json.created_at from json where url="http://github.com/'+f.user+'.json"'),dataType:"jsonp",success:function(a){var e=[],b=0,g;if(a.query&&a.query.count&&a.query.count>0)for(g=a.query.count;b<g;b++){var j=a.query.results.json[b].json;e.push({date:new Date(j.created_at),config:f,html:c(j)})}i(e)}})};
+h.fn.lifestream.feeds.googlereader=function(f,i){h.ajax({url:m('select * from xml where url="www.google.com/reader/public/atom/user%2F'+f.user+'%2Fstate%2Fcom.google%2Fstarred"'),dataType:"jsonp",success:function(d){var c=[],a=0,e;if(d.query&&d.query.count&&d.query.count>0){d=d.query.results.feed.entry;for(e=d.length;a<e;a++){var b=d[a];c.push({date:new Date(parseInt(b["crawl-timestamp-msec"],10)),config:f,html:'starred post <a href="'+b.link.href+'">'+b.title.content+"</a>"})}}i(c)}})};h.fn.lifestream.feeds.iusethis=
+function(f,i){h.ajax({url:m('select * from xml where url="http://iphone.iusethis.com/user/feed.rss/'+f.user+'" or url="http://osx.iusethis.com/user/feed.rss/'+f.user+'" or url="http://win.iusethis.com/user/feed.rss/'+f.user+'"'),dataType:"jsonp",success:function(d){var c=[],a,e,b,g,j,k=0,o,l,n,p,q,r,s=["iPhone","OS X","Windows"];if(d.query&&d.query.count&&d.query.count>0&&d.query.results.rss){o=d.query.results.rss.length;p=["started using","stopped using","stopped loving","Downloaded","commented on",
+"updated entry for","started loving","registered"];for(j=p.length;k<o;k++){r=s[k];a=d.query.results.rss[k].channel.item;e=0;for(b=a.length;e<b;e++){l=a[e];n=l.title.replace(f.user+" ","");for(g=0;g<j;g++)if(n.indexOf(p[g])>-1){q=p[g];break}g=n.split(q);c.push({date:new Date(l.pubDate),config:f,html:q.toLowerCase()+' <a href="'+l.link+'">'+g[1]+"</a> ("+r+")"})}}}i(c)}})};h.fn.lifestream.feeds.lastfm=function(f,i){var d=function(c){var a="";a+='loved <a href="'+c.url+'">'+c.name+'</a> by <a href="'+
+c.artist.url+'">'+c.artist.name+"</a>";return a};h.ajax({url:m('select * from xml where url="http://ws.audioscrobbler.com/2.0/user/'+f.user+'/lovedtracks.xml"'),dataType:"jsonp",success:function(c){var a=[],e=0,b;if(c.query&&c.query.count&&c.query.count>0&&c.query.results.lovedtracks&&c.query.results.lovedtracks.track){c=c.query.results.lovedtracks.track;for(b=c.length;e<b;e++){var g=c[e];a.push({date:new Date(parseInt(g.date.uts*1E3,10)),config:f,html:d(g)})}}i(a)}})};h.fn.lifestream.feeds.picplz=
+function(f,i){h.ajax({url:"http://picplz.com/api/v2/user.json?username="+f.user+"&include_pics=1",dataType:"jsonp",success:function(d){var c=[],a=0,e;if((e=d.value.users[0].pics)&&e.length&&e.length>0)for(d=e.length;a<d;a++){var b=e[a];c.push({date:new Date(b.date*1E3),config:f,html:'Uploaded <a href="'+b.pic_files["640r"].img_url+'">'+(b.caption||b.id)+"</a>"})}i(c)}})};h.fn.lifestream.feeds.pinboard=function(f,i){h.ajax({url:m('select * from xml where url="http://feeds.pinboard.in/rss/u:'+f.user+
+'"'),dataType:"jsonp",success:function(d){var c=[],a=0,e,b;if(d.query&&d.query.count&&d.query.count>0){d=d.query.results.RDF.item;for(e=d.length;a<e;a++){b=d[a];c.push({date:new Date(b.date),config:f,html:'added bookmark <a href="'+b.link+'">'+b.title+"</a>"})}}i(c)}})};h.fn.lifestream.feeds.reddit=function(f,i){var d=function(c){var a="",e="",b="http://www.reddit.com/r/"+c.data.subreddit,g=c.data.ups-c.data.downs;g=g>0?"+"+g:g;if(c.kind==="t1"){e="http://www.reddit.com/r/"+c.data.subreddit+"/comments/"+
+c.data.link_id.substring(3)+"/u/"+c.data.name.substring(3)+"?context=3";a+='<a href="'+e+'">commented ('+g+")</a> "}else if(c.kind==="t3")a+='<a href="http://www.reddit.com'+c.data.permalink+'">created new thread ('+g+")</a> ";a+=' in <a href="'+b+'">/r/'+c.data.subreddit+"</a>";return a};h.ajax({url:"http://www.reddit.com/user/"+f.user+".json",dataType:"jsonp",jsonp:"jsonp",success:function(c){var a=[],e=0,b;if(c&&c.data&&c.data.children&&c.data.children.length>0)for(b=c.data.children.length;e<b;e++){var g=
+c.data.children[e];a.push({date:new Date(g.data.created*1E3),config:f,html:d(g)})}i(a)}})};h.fn.lifestream.feeds.slideshare=function(f,i){h.ajax({url:m('select * from xml where url="http://www.slideshare.net/rss/user/'+f.user+'"'),dataType:"jsonp",success:function(d){var c=[],a=0,e,b;if(d.query&&d.query.count&&d.query.count>0){d=d.query.results.rss.channel.item;for(e=d.length;a<e;a++){b=d[a];c.push({date:new Date(b.pubDate),config:f,html:'uploaded a presentation <a href="'+b.link+'">'+b.title+"</a>"})}}i(c)}})};
+h.fn.lifestream.feeds.stackoverflow=function(f,i){var d=function(c){var a="",e="",b="",g="",j="http://stackoverflow.com/users/"+f.user;if(c.timeline_type==="badge"){e=c.timeline_type+" "+c.action+": "+c.description;b=c.detail;g=j+"?tab=reputation"}else if(c.timeline_type==="revision"||c.timeline_type==="comment"||c.timeline_type==="accepted"||c.timeline_type==="askoranswered"){e=c.post_type+" "+c.action;b=c.detail||c.description||"";g="http://stackoverflow.com/questions/"+c.post_id}a+='<a href="'+
+g+'" title="'+b+'">'+e+"</a> - "+b;return a};h.ajax({url:"http://api.stackoverflow.com/1.1/users/"+f.user+"/timeline?jsonp",dataType:"jsonp",jsonp:"jsonp",success:function(c){var a=[],e=0,b;if(c&&c.total&&c.total>0&&c.user_timelines)for(b=c.user_timelines.length;e<b;e++){var g=c.user_timelines[e];a.push({date:new Date(g.creation_date*1E3),config:f,html:d(g)})}i(a)}})};h.fn.lifestream.feeds.tumblr=function(f,i){var d=function(c,a){return{date:new Date(a.date),config:c,html:"posted a "+a.type+' <a href="'+
+a.url+'">'+(a["regular-title"]||a["quote-text"]||a["conversation-title"]||a["photo-caption"]||a["video-caption"]||a["audio-caption"]||a["regular-body"]||a["link-text"]||a.type||"").replace(/\<.+?\>/gi," ")+"</a>"}};h.ajax({url:m('select * from tumblr.posts where username="'+f.user+'"'),dataType:"jsonp",success:function(c){var a=[],e=0,b,g;if(c.query&&c.query.count&&c.query.count>0)if(h.isArray(c.query.results.posts.post))for(b=c.query.results.posts.post.length;e<b;e++){g=c.query.results.posts.post[e];
+a.push(d(f,g))}else h.isPlainObject(c.query.results.posts.post)&&a.push(d(f,c.query.results.posts.post));i(a)}})};h.fn.lifestream.feeds.twitter=function(f,i){var d=function(c){return h.fn.lifestream.linkify(c).replace(/ #([A-Za-z0-9\/\.]*)/g,function(a){return' <a target="_new" href="http://twitter.com/search?q='+a.replace(" #","%23")+'">'+a+"</a>"}).replace(/@[\w]+/g,function(a){return'<a href="http://www.twitter.com/'+a.replace("@","")+'">'+a+"</a>"})};h.ajax({url:m('select status.id, status.created_at, status.text from twitter.user.timeline where screen_name="'+
+f.user+'"'),dataType:"jsonp",success:function(c){var a=[],e=0,b;if(c.query&&c.query.count&&c.query.count>0)for(b=c.query.count;e<b;e++){var g=c.query.results.statuses[e].status;a.push({date:new Date(g.created_at),config:f,html:d(g.text)})}i(a)}})};h.fn.lifestream.feeds.vimeo=function(f,i){h.ajax({url:"http://vimeo.com/api/v2/"+f.user+"/videos.json",dataType:"jsonp",crossDomain:true,success:function(d){var c=[],a=0,e,b;if(d)for(e=d.length;a<e;a++){b=d[a];c.push({date:new Date(b.upload_date),config:f,
+html:'published a video <a href="'+b.url+'" title="'+b.description.replace(/"/g,"'").replace(/\<.+?\>/gi,"")+'">'+b.title+"</a>"})}i(c)}})};h.fn.lifestream.feeds.youtube=function(f,i){h.ajax({url:"http://gdata.youtube.com/feeds/api/users/"+f.user+"/favorites?v=2&alt=jsonc",dataType:"jsonp",success:function(d){var c=[],a=0,e,b;if(d.data&&d.data.items)for(e=d.data.items.length;a<e;a++){b=d.data.items[a];c.push({date:new Date(b.created),config:f,html:' favorited <a href="'+b.video.player["default"]+
+'" title="'+b.video.description+'">'+b.video.title+"</a>"})}i(c)}})}})(jQuery);
View
70 jquery.lifestream.js
@@ -1,6 +1,6 @@
/*!
* jQuery Lifestream Plug-in
- * @version 0.0.17
+ * @version 0.1.0
* Show a stream of your online activity
*
* Copyright 2011, Christian Vuerings - http://denbuzze.com
@@ -50,26 +50,19 @@
}
});
- var
- items = data.items,
- length = (items.length < settings.limit)?
- items.length :
- settings.limit,
- i = 0, item,
- ul = $('<ul class="' + settings.classname + '"/>')
- ;
+ var items = data.items,
+ length = (items.length < settings.limit) ?
+ items.length :
+ settings.limit,
+ i = 0, item,
+ ul = $('<ul class="' + settings.classname + '"/>');
for ( ; i < length; ++i) {
item = items[i];
- if (item.config.template)
- $('<li class="'+ settings.classname + '-' + item.config.service + '">')
- .append(
- $.tmpl(item.config.template[item.data.activity], item.data))
- .appendTo(ul)
- else if (item.html)
- ul.append('<li class="'+ settings.classname + '-'
- + item.config.service + '">'
- + item.html + '</li>');
+ if (item.html) {
+ $('<li class="'+ settings.classname + '-'
+ + item.config.service + '">').append(item.html).appendTo(ul);
+ }
}
outputElement.html(ul);
@@ -93,7 +86,14 @@
}
};
- load();
+ // If the jQuery templates plug-in wasn't included before, we load it here.
+ if(!jQuery.tmpl){
+ jQuery.getScript(
+ "https://raw.github.com/jquery/jquery-tmpl/master/jquery.tmpl.min.js",
+ load);
+ } else {
+ load();
+ }
};
@@ -266,7 +266,7 @@
}());
$.fn.lifestream.feeds = $.fn.lifestream.feeds || {};
-
+
$.fn.lifestream.feeds.dailymotion = function (config, callback) {
var parseDailymotion = function (input) {
@@ -303,10 +303,8 @@
};
$.fn.lifestream.feeds.delicious = function f(config, callback) {
- config.template = $.extend({},
- f.template,
- config.template);
-
+ config.template = $.extend({}, f.template, config.template);
+
$.ajax({
url: "http://feeds.delicious.com/v2/json/" + config.user,
dataType: "jsonp",
@@ -319,11 +317,10 @@
output.push({
date: new Date(item.dt),
config: config,
- data: {
- activity: 'bookmarkcreation',
+ html: $.tmpl(config.template.bookmarkcreation, {
url: item.u,
title: item.d
- }
+ })
});
}
}
@@ -336,9 +333,7 @@
};
$.fn.lifestream.feeds.deviantart = function f(config, callback) {
- config.template = $.extend({},
- f.template,
- config.template);
+ config.template = $.extend({}, f.template, config.template);
$.ajax({
url: createYqlUrl(
@@ -361,11 +356,10 @@
output.push({
date: new Date(item.pubDate),
config: config,
- data: {
- activity: 'deviationpost',
- title: item.title,
- url: item.link
- }
+ html: $.tmpl(config.template.deviationpost, {
+ url: item.link,
+ title: item.title
+ })
});
}
}
@@ -470,7 +464,7 @@
}
});
};
-
+
$.fn.lifestream.feeds.foursquare = function(config, callback){
var parseFoursquareStatus = function(item){
@@ -719,7 +713,7 @@
});
};
-
+
$.fn.lifestream.feeds.lastfm = function(config, callback){
var parseLastfmEntry = function(entry){
var output = "";
@@ -826,7 +820,7 @@
});
};
-
+
$.fn.lifestream.feeds.reddit = function(config, callback){
/**
View
4 jquery.lifestream.min.js
@@ -1,8 +1,8 @@
/*!
* jQuery Lifestream Plug-in
- * @version 0.0.17
+ * @version 0.1.0
* Show a stream of your online activity
*
* Copyright 2011, Christian Vuerings - http://denbuzze.com
*/
-(function($){var createYqlUrl=function(query){return("http://query.yahooapis.com/v1/public/yql?q=__QUERY__&env=store://datatables.org/alltableswithkeys&format=json").replace("__QUERY__",encodeURIComponent(query))};$.fn.lifestream=function(config){var outputElement=this,settings=jQuery.extend({classname:"lifestream",limit:10},config),data={count:settings.list.length,items:[]},itemsettings=jQuery.extend(true,{},settings),finished=function(inputdata){$.merge(data.items,inputdata);data.items.sort(function(a,b){if(a.date>b.date){return -1}else{if(a.date===b.date){return 0}else{return 1}}});var ul=$('<ul class="'+settings.classname+'"/>'),length=(data.items.length<settings.limit)?data.items.length:settings.limit,i=0;for(;i<length;i++){if(data.items[i].html){ul.append('<li class="'+settings.classname+"-"+data.items[i].service+'">'+data.items[i].html+"</li>")}}outputElement.html(ul)},load=function(){var i=0,j=settings.list.length;delete itemsettings.list;for(;i<j;i++){var item=settings.list[i];if($.fn.lifestream.feeds[item.service]&&$.isFunction($.fn.lifestream.feeds[item.service])&&item.user){item._settings=itemsettings;$.fn.lifestream.feeds[item.service](item,finished)}}};load()};$.fn.lifestream.linkify=(function(){var SCHEME="[a-z\\d.-]+://",IPV4="(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])",HOSTNAME="(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+",TLD="(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)",HOST_OR_IP="(?:"+HOSTNAME+TLD+"|"+IPV4+")",PATH="(?:[;/][^#?<>\\s]*)?",QUERY_FRAG="(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?",URI1="\\b"+SCHEME+"[^<>\\s]+",URI2="\\b"+HOST_OR_IP+PATH+QUERY_FRAG+"(?!\\w)",MAILTO="mailto:",EMAIL="(?:"+MAILTO+")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+HOST_OR_IP+QUERY_FRAG+"(?!\\w)",URI_RE=new RegExp("(?:"+URI1+"|"+URI2+"|"+EMAIL+")","ig"),SCHEME_RE=new RegExp("^"+SCHEME,"i"),quotes={"'":"`",">":"<",")":"(","]":"[","}":"{","»":"«","›":"‹"},default_options={callback:function(text,href){return href?'<a href="'+href+'" title="'+href+'">'+text+"</a>":text},punct_regexp:/(?:[!?.,:;'"]|(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(txt,options){options=options||{};var arr,i,link,href,html="",parts=[],idx_prev,idx_last,idx,link_last,matches_begin,matches_end,quote_begin,quote_end;for(i in default_options){if(default_options.hasOwnProperty(i)&&options[i]===undefined){options[i]=default_options[i]}}while(arr=URI_RE.exec(txt)){link=arr[0];idx_last=URI_RE.lastIndex;idx=idx_last-link.length;if(/[\/:]/.test(txt.charAt(idx-1))){continue}do{link_last=link;quote_end=link.substr(-1);quote_begin=quotes[quote_end];if(quote_begin){matches_begin=link.match(new RegExp("\\"+quote_begin+"(?!$)","g"));matches_end=link.match(new RegExp("\\"+quote_end,"g"));if((matches_begin?matches_begin.length:0)<(matches_end?matches_end.length:0)){link=link.substr(0,link.length-1);idx_last--}}if(options.punct_regexp){link=link.replace(options.punct_regexp,function(a){idx_last-=a.length;return""})}}while(link.length&&link!==link_last);href=link;if(!SCHEME_RE.test(href)){href=(href.indexOf("@")!==-1?(!href.indexOf(MAILTO)?"":MAILTO):!href.indexOf("irc.")?"irc://":!href.indexOf("ftp.")?"ftp://":"http://")+href}if(idx_prev!=idx){parts.push([txt.slice(idx_prev,idx)]);idx_prev=idx_last}parts.push([link,href])}parts.push([txt.substr(idx_prev)]);for(i=0;i<parts.length;i++){html+=options.callback.apply(window,parts[i])}return html||txt}}());$.fn.lifestream.feeds=$.fn.lifestream.feeds||{};$.fn.lifestream.feeds.dailymotion=function(obj,callback){var parseDailymotion=function(input){var output=[],list,i=0,j,item;if(input.query&&input.query.count&&input.query.count>0&&input.query.results.rss.channel.item){list=input.query.results.rss.channel.item;j=list.length;for(;i<j;i++){item=list[i];output.push({date:new Date(item.pubDate),service:obj.service,html:'uploaded a video <a href="'+item.link+'">'+item.title+"</a>"})}}return output};$.ajax({url:createYqlUrl('select * from xml where url="http://www.dailymotion.com/rss/user/'+obj.user+'"'),dataType:"jsonp",success:function(data){callback(parseDailymotion(data))}})};$.fn.lifestream.feeds.delicious=function(obj,callback){var parseDeliciousItem=function(item){var output="";output+='added bookmark <a href="'+item.u+'">'+item.d+"</a>";return output};$.ajax({url:"http://feeds.delicious.com/v2/json/"+obj.user,dataType:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.length&&data.length>0){j=data.length;for(;i<j;i++){var item=data[i];output.push({date:new Date(item.dt),service:obj.service,html:parseDeliciousItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.deviantart=function(obj,callback){$.ajax({url:createYqlUrl('select title,link,pubDate from rss where url="http://backend.deviantart.com/rss.xml?q=gallery%3A'+encodeURIComponent(obj.user)+'&type=deviation" | unique(field="title")'),dataType:"jsonp",success:function(resp){var output=[],items,item,i=0,j;if(resp.query&&resp.query.count>0){items=resp.query.results.item;j=items.length;for(;i<j;++i){item=items[i];output.push({date:new Date(item.pubDate),service:obj.service,html:'posted <a href="'+item.link+'">'+item.title+"</a>"})}}callback(output)}})};$.fn.lifestream.feeds.dribbble=function(obj,callback){var parseDribbbleItem=function(item){var output='posted a shot <a href="'+item.url+'">'+item.title+"</a>";return output};$.ajax({url:"http://api.dribbble.com/players/"+obj.user+"/shots",dataType:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.total){j=data.shots.length;for(;i<j;i++){var item=data.shots[i];output.push({date:new Date(item.created_at),service:obj.service,html:parseDribbbleItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.flickr=function(obj,callback){var parseFlickrItem=function(item){var output='posted a photo <a href="'+item.link+'">'+item.title+"</a>";return output};$.ajax({url:"http://api.flickr.com/services/feeds/photos_public.gne?id="+obj.user+"&lang=en-us&format=json",dataType:"jsonp",jsonp:"jsoncallback",success:function(data){var output=[],i=0,j;if(data&&data.items&&data.items.length>0){j=data.items.length;for(;i<j;i++){var item=data.items[i];output.push({date:new Date(item.published),service:obj.service,html:parseFlickrItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.forrst=function(obj,callback){var parseForrstItem=function(item){return"Posted a "+item.post_type+' titled <a href="'+item.post_url+'">'+item.title+"</a>"};$.ajax({url:"http://forrst.com/api/v2/users/posts?username="+obj.user+"",dataType:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.resp.length&&data.resp.length>0){j=data.resp.length;for(;i<j;i++){var item=data.resp[i];output.push({date:new Date(item.created_at),service:obj.service,html:parseForrstItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.foursquare=function(obj,callback){var parseFoursquareStatus=function(item){var output='checked in @ <a href="'+item.link+'">'+item.title+"</a>";return output},parseFoursquare=function(input){var output=[],i=0,j;if(input.query&&input.query.count&&input.query.count>0){j=input.query.count;for(;i<j;i++){var status=input.query.results.item[i];output.push({date:new Date(status.pubDate),service:obj.service,html:parseFoursquareStatus(status)})}}return output};$.ajax({url:createYqlUrl('select * from rss where url="https://feeds.foursquare.com/history/'+obj.user+'.rss"'),dataType:"jsonp",success:function(data){callback(parseFoursquare(data))}})};$.fn.lifestream.feeds.github=function(obj,callback){var returnRepo=function(status){return status.payload.repo||status.repository.owner+"/"+status.repository.name},parseGithubStatus=function(status){var output="",name,repo,title,type;if(status.type==="PushEvent"){title="";repo=returnRepo(status);if(status.payload&&status.payload.shas&&status.payload.shas.json&&status.payload.shas.json[2]){title=status.payload.shas.json[2]+" by "+status.payload.shas.json[3]}output+='<a href="'+status.url+'" title="'+title+'">pushed</a> to <a href="http://github.com/'+repo+'">'+repo+"</a>"}else{if(status.type==="GistEvent"){title=status.payload.desc||"";output+=status.payload.action+'d <a href="'+status.payload.url+'" title ="'+title+'">'+status.payload.name+"</a>"}else{if(status.type==="CommitCommentEvent"||status.type==="IssueCommentEvent"){repo=returnRepo(status);output+='<a href="'+status.url+'">commented</a> on <a href="http://github.com/'+repo+'">'+repo+"</a>"}else{if(status.type==="PullRequestEvent"){repo=status.payload.repo||status.repository.owner+"/"+status.repository.name;output+='<a href="'+status.url+'">'+status.payload.action+'</a> pull request on <a href="http://github.com/'+repo+'">'+repo+"</a>"}else{if(status.type==="CreateEvent"&&(status.payload.ref_type==="tag"||status.payload.ref_type==="branch"||status.payload.object==="tag")){repo=returnRepo(status);type=status.payload.ref_type||status.payload.object;name=status.payload.ref||status.payload.object_name;output+="created "+type+' <a href="'+status.url+'">'+name+'</a> for <a href="http://github.com/'+repo+'">'+repo+"</a>"}else{if(status.type==="CreateEvent"){name=(status.payload.object_name==="null")?status.payload.name:status.payload.object_name;output+="created "+status.payload.object+' <a href="'+status.url+'">'+name+"</a>"}else{if(status.type==="DeleteEvent"){output+="deleted "+status.payload.ref_type+' <a href="http://github.com/'+status.repository.owner+"/"+status.repository.name+'">'+status.payload.ref+"</a>"}}}}}}}return output},parseGithub=function(input){var output=[],i=0,j;if(input.query&&input.query.count&&input.query.count>0){j=input.query.count;for(;i<j;i++){var status=input.query.results.json[i].json;output.push({date:new Date(status.created_at),service:obj.service,html:parseGithubStatus(status)})}}return output};$.ajax({url:createYqlUrl('select json.repository.owner,json.repository.name,json.payload,json.type,json.url, json.created_at from json where url="http://github.com/'+obj.user+'.json"'),dataType:"jsonp",success:function(data){callback(parseGithub(data))}})};$.fn.lifestream.feeds.googlereader=function(obj,callback){var parseReaderEntry=function(entry){return'starred post <a href="'+entry.link.href+'">'+entry.title.content+"</a>"},parseReader=function(input){var output=[],list,i=0,j;if(input.query&&input.query.count&&input.query.count>0){list=input.query.results.feed.entry;j=list.length;for(;i<j;i++){var entry=list[i];output.push({date:new Date(parseInt(entry["crawl-timestamp-msec"],10)),service:obj.service,html:parseReaderEntry(entry)})}}return output};$.ajax({url:createYqlUrl('select * from xml where url="www.google.com/reader/public/atom/user%2F'+obj.user+'%2Fstate%2Fcom.google%2Fstarred"'),dataType:"jsonp",success:function(data){callback(parseReader(data))}})};$.fn.lifestream.feeds.iusethis=function(obj,callback){var parseIusethis=function(input){var output=[],list,i,j,k,l,m=0,n,item,title,actions,action,what,os,oss=["iPhone","OS X","Windows"];if(input.query&&input.query.count&&input.query.count>0&&input.query.results.rss){n=input.query.results.rss.length;actions=["started using","stopped using","stopped loving","Downloaded","commented on","updated entry for","started loving","registered"],l=actions.length;for(;m<n;m++){os=oss[m];list=input.query.results.rss[m].channel.item;i=0;j=list.length;for(;i<j;i++){item=list[i];title=item.title.replace(obj.user+" ","");k=0;for(;k<l;k++){if(title.indexOf(actions[k])>-1){action=actions[k];break}}what=title.split(action);output.push({date:new Date(item.pubDate),service:obj.service,html:action.toLowerCase()+' <a href="'+item.link+'">'+what[1]+"</a> ("+os+")"})}}}return output};$.ajax({url:createYqlUrl('select * from xml where url="http://iphone.iusethis.com/user/feed.rss/'+obj.user+'" or url="http://osx.iusethis.com/user/feed.rss/'+obj.user+'" or url="http://win.iusethis.com/user/feed.rss/'+obj.user+'"'),dataType:"jsonp",success:function(data){callback(parseIusethis(data))}})};$.fn.lifestream.feeds.lastfm=function(obj,callback){var parseLastfmEntry=function(entry){var output="";output+='loved <a href="'+entry.url+'">'+entry.name+'</a> by <a href="'+entry.artist.url+'">'+entry.artist.name+"</a>";return output},parseLastfm=function(input){var output=[],list,i=0,j;if(input.query&&input.query.count&&input.query.count>0&&input.query.results.lovedtracks&&input.query.results.lovedtracks.track){list=input.query.results.lovedtracks.track;j=list.length;for(;i<j;i++){var entry=list[i];output.push({date:new Date(parseInt((entry.date.uts*1000),10)),service:obj.service,html:parseLastfmEntry(entry)})}}return output};$.ajax({url:createYqlUrl('select * from xml where url="http://ws.audioscrobbler.com/2.0/user/'+obj.user+'/lovedtracks.xml"'),dataType:"jsonp",success:function(data){callback(parseLastfm(data))}})};$.fn.lifestream.feeds.picplz=function(obj,callback){var parsePicplzItem=function(item){var imagename=item.caption||item.id;return'Uploaded <a href="'+item.pic_files["640r"].img_url+'">'+imagename+"</a>"};$.ajax({url:"http://picplz.com/api/v2/user.json?username="+obj.user+"&include_pics=1",dataType:"jsonp",success:function(data){var output=[],i=0,j,images;images=data.value.users[0].pics;if(images&&images.length&&images.length>0){j=images.length;for(;i<j;i++){var item=images[i];output.push({date:new Date((item.date)*1000),service:obj.service,html:parsePicplzItem(item)})}}callback(output)}})};$.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){var parseRedditItem=function(item){var output="",thread_link="",subreddit_link="http://www.reddit.com/r/"+item.data.subreddit,score=item.data.ups-item.data.downs;score=(score>0)?"+"+score:score;if(item.kind==="t1"){thread_link="http://www.reddit.com/r/"+item.data.subreddit+"/comments/"+item.data.link_id.substring(3)+"/u/"+item.data.name.substring(3)+"?context=3";output+='<a href="'+thread_link+'">commented ('+score+")</a> "}else{if(item.kind==="t3"){output+='<a href="http://www.reddit.com'+item.data.permalink+'">created new thread ('+score+")</a> "}}output+=' in <a href="'+subreddit_link+'">/r/'+item.data.subreddit+"</a>";return output},convertDate=function(date){return new Date(date*1000)};$.ajax({url:"http://www.reddit.com/user/"+obj.user+".json",dataType:"jsonp",jsonp:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.data&&data.data.children&&data.data.children.length>0){j=data.data.children.length;for(;i<j;i++){var item=data.data.children[i];output.push({date:convertDate(item.data.created),service:obj.service,html:parseRedditItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.slideshare=function(obj,callback){var parseSlideshare=function(input){var output=[],list,i=0,j,item;if(input.query&&input.query.count&&input.query.count>0){list=input.query.results.rss.channel.item;j=list.length;for(;i<j;i++){item=list[i];output.push({date:new Date(item.pubDate),service:obj.service,html:'uploaded a presentation <a href="'+item.link+'">'+item.title+"</a>"})}}return output};$.ajax({url:createYqlUrl('select * from xml where url="http://www.slideshare.net/rss/user/'+obj.user+'"'),dataType:"jsonp",success:function(data){callback(parseSlideshare(data))}})};$.fn.lifestream.feeds.stackoverflow=function(obj,callback){var parseStackoverflowItem=function(item){var output="",text="",title="",link="",stackoverflow_link="http://stackoverflow.com/users/"+obj.user,question_link="http://stackoverflow.com/questions/";if(item.timeline_type==="badge"){text=item.timeline_type+" "+item.action+": "+item.description;title=item.detail;link=stackoverflow_link+"?tab=reputation"}else{if(item.timeline_type==="revision"||item.timeline_type==="comment"||item.timeline_type==="accepted"||item.timeline_type==="askoranswered"){text=item.post_type+" "+item.action;title=item.detail||item.description||"";link=question_link+item.post_id}}output+='<a href="'+link+'" title="'+title+'">'+text+"</a> - "+title;return output},convertDate=function(date){return new Date(date*1000)};$.ajax({url:"http://api.stackoverflow.com/1.1/users/"+obj.user+"/timeline?jsonp",dataType:"jsonp",jsonp:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.total&&data.total>0&&data.user_timelines){j=data.user_timelines.length;for(;i<j;i++){var item=data.user_timelines[i];output.push({date:convertDate(item.creation_date),service:obj.service,html:parseStackoverflowItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.tumblr=function(obj,callback){var getTitle=function(post){var title=post["regular-title"]||post["quote-text"]||post["conversation-title"]||post["photo-caption"]||post["video-caption"]||post["audio-caption"]||post["regular-body"]||post["link-text"]||post.type||"";return title.replace(/\<.+?\>/gi," ")},createTumblrOutput=function(obj,post){return{date:new Date(post.date),service:obj.service,html:"posted a "+post.type+' <a href="'+post.url+'">'+getTitle(post)+"</a>"}},parseTumblr=function(input){var output=[],i=0,j,post;if(input.query&&input.query.count&&input.query.count>0){if($.isArray(input.query.results.posts.post)){j=input.query.results.posts.post.length;for(;i<j;i++){post=input.query.results.posts.post[i];output.push(createTumblrOutput(obj,post))}}else{if($.isPlainObject(input.query.results.posts.post)){output.push(createTumblrOutput(obj,input.query.results.posts.post))}}}return output};$.ajax({url:createYqlUrl('select * from tumblr.posts where username="'+obj.user+'"'),dataType:"jsonp",success:function(data){callback(parseTumblr(data))}})};$.fn.lifestream.feeds.twitter=function(obj,callback){var addTwitterLinks=function(tweet){return $.fn.lifestream.linkify(tweet).replace(/ #([A-Za-z0-9\/\.]*)/g,function(m){return' <a target="_new" href="http://twitter.com/search?q='+m.replace(" #","%23")+'">'+m+"</a>"}).replace(/@[\w]+/g,function(m){return'<a href="http://www.twitter.com/'+m.replace("@","")+'">'+m+"</a>"})},parseTwitter=function(input){var output=[],i=0,j;if(input.query&&input.query.count&&input.query.count>0){j=input.query.count;for(;i<j;i++){var status=input.query.results.statuses[i].status;output.push({date:new Date(status.created_at),service:obj.service,html:addTwitterLinks(status.text)})}}return output};$.ajax({url:createYqlUrl('select status.id, status.created_at, status.text from twitter.user.timeline where screen_name="'+obj.user+'"'),dataType:"jsonp",success:function(data){callback(parseTwitter(data))}})};$.fn.lifestream.feeds.vimeo=function(obj,callback){var parseVimeoItem=function(item){return'published a video <a href="'+item.url+'" title="'+item.description.replace(/"/g,"'").replace(/\<.+?\>/gi,"")+'">'+item.title+"</a>"},parseVimeo=function(input){var output=[],i=0,j,item;if(input){j=input.length;for(;i<j;i++){item=input[i];output.push({date:new Date(item.upload_date),service:obj.service,html:parseVimeoItem(item)})}}return output};$.ajax({url:"http://vimeo.com/api/v2/"+obj.user+"/videos.json",dataType:"jsonp",crossDomain:true,success:function(data){callback(parseVimeo(data))}})};$.fn.lifestream.feeds.youtube=function(obj,callback){var parseYoutubeItem=function(item){return' favorited <a href="'+item.video.player["default"]+'" title="'+item.video.description+'">'+item.video.title+"</a>"},parseYoutube=function(input){var output=[],i=0,j,item;if(input.data&&input.data.items){j=input.data.items.length;for(;i<j;i++){item=input.data.items[i];output.push({date:new Date(item.created),service:obj.service,html:parseYoutubeItem(item)})}}return output};$.ajax({url:"http://gdata.youtube.com/feeds/api/users/"+obj.user+"/favorites?v=2&alt=jsonc",dataType:"jsonp",success:function(data){callback(parseYoutube(data))}})}}(jQuery));
+(function($){var createYqlUrl=function(query){return("http://query.yahooapis.com/v1/public/yql?q=__QUERY__&env=store://datatables.org/alltableswithkeys&format=json").replace("__QUERY__",encodeURIComponent(query))};$.fn.lifestream=function(config){var outputElement=this,settings=jQuery.extend({classname:"lifestream",limit:10},config),data={count:settings.list.length,items:[]},itemsettings=jQuery.extend(true,{},settings),finished=function(inputdata){$.merge(data.items,inputdata);data.items.sort(function(a,b){if(a.date>b.date){return -1}else{if(a.date===b.date){return 0}else{return 1}}});var items=data.items,length=(items.length<settings.limit)?items.length:settings.limit,i=0,item,ul=$('<ul class="'+settings.classname+'"/>');for(;i<length;++i){item=items[i];if(item.html){$('<li class="'+settings.classname+"-"+item.config.service+'">').append(item.html).appendTo(ul)}}outputElement.html(ul)},load=function(){var i=0,j=settings.list.length;delete itemsettings.list;for(;i<j;i++){var config=settings.list[i];if($.fn.lifestream.feeds[config.service]&&$.isFunction($.fn.lifestream.feeds[config.service])&&config.user){config._settings=itemsettings;$.fn.lifestream.feeds[config.service](config,finished)}}};if(!jQuery.tmpl){jQuery.getScript("https://raw.github.com/jquery/jquery-tmpl/master/jquery.tmpl.min.js",load)}else{load()}};$.fn.lifestream.linkify=(function(){var SCHEME="[a-z\\d.-]+://",IPV4="(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])",HOSTNAME="(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+",TLD="(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)",HOST_OR_IP="(?:"+HOSTNAME+TLD+"|"+IPV4+")",PATH="(?:[;/][^#?<>\\s]*)?",QUERY_FRAG="(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?",URI1="\\b"+SCHEME+"[^<>\\s]+",URI2="\\b"+HOST_OR_IP+PATH+QUERY_FRAG+"(?!\\w)",MAILTO="mailto:",EMAIL="(?:"+MAILTO+")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+HOST_OR_IP+QUERY_FRAG+"(?!\\w)",URI_RE=new RegExp("(?:"+URI1+"|"+URI2+"|"+EMAIL+")","ig"),SCHEME_RE=new RegExp("^"+SCHEME,"i"),quotes={"'":"`",">":"<",")":"(","]":"[","}":"{","»":"«","›":"‹"},default_options={callback:function(text,href){return href?'<a href="'+href+'" title="'+href+'">'+text+"</a>":text},punct_regexp:/(?:[!?.,:;'"]|(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(txt,options){options=options||{};var arr,i,link,href,html="",parts=[],idx_prev,idx_last,idx,link_last,matches_begin,matches_end,quote_begin,quote_end;for(i in default_options){if(default_options.hasOwnProperty(i)&&options[i]===undefined){options[i]=default_options[i]}}while(arr=URI_RE.exec(txt)){link=arr[0];idx_last=URI_RE.lastIndex;idx=idx_last-link.length;if(/[\/:]/.test(txt.charAt(idx-1))){continue}do{link_last=link;quote_end=link.substr(-1);quote_begin=quotes[quote_end];if(quote_begin){matches_begin=link.match(new RegExp("\\"+quote_begin+"(?!$)","g"));matches_end=link.match(new RegExp("\\"+quote_end,"g"));if((matches_begin?matches_begin.length:0)<(matches_end?matches_end.length:0)){link=link.substr(0,link.length-1);idx_last--}}if(options.punct_regexp){link=link.replace(options.punct_regexp,function(a){idx_last-=a.length;return""})}}while(link.length&&link!==link_last);href=link;if(!SCHEME_RE.test(href)){href=(href.indexOf("@")!==-1?(!href.indexOf(MAILTO)?"":MAILTO):!href.indexOf("irc.")?"irc://":!href.indexOf("ftp.")?"ftp://":"http://")+href}if(idx_prev!=idx){parts.push([txt.slice(idx_prev,idx)]);idx_prev=idx_last}parts.push([link,href])}parts.push([txt.substr(idx_prev)]);for(i=0;i<parts.length;i++){html+=options.callback.apply(window,parts[i])}return html||txt}}());$.fn.lifestream.feeds=$.fn.lifestream.feeds||{};$.fn.lifestream.feeds.dailymotion=function(config,callback){var parseDailymotion=function(input){var output=[],list,i=0,j,item;if(input.query&&input.query.count&&input.query.count>0&&input.query.results.rss.channel.item){list=input.query.results.rss.channel.item;j=list.length;for(;i<j;i++){item=list[i];output.push({date:new Date(item.pubDate),config:config,html:'uploaded a video <a href="'+item.link+'">'+item.title+"</a>"})}}return output};$.ajax({url:createYqlUrl('select * from xml where url="http://www.dailymotion.com/rss/user/'+config.user+'"'),dataType:"jsonp",success:function(data){callback(parseDailymotion(data))}})};$.fn.lifestream.feeds.delicious=function f(config,callback){config.template=$.extend({},f.template,config.template);$.ajax({url:"http://feeds.delicious.com/v2/json/"+config.user,dataType:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.length&&data.length>0){j=data.length;for(;i<j;i++){var item=data[i];output.push({date:new Date(item.dt),config:config,html:$.tmpl(config.template.bookmarkcreation,{url:item.u,title:item.d})})}}callback(output)}})};$.fn.lifestream.feeds.delicious.template={bookmarkcreation:'bookmarked <a href="${url}">${title}</a>'};$.fn.lifestream.feeds.deviantart=function f(config,callback){config.template=$.extend({},f.template,config.template);$.ajax({url:createYqlUrl('select title,link,pubDate from rss where url="http://backend.deviantart.com/rss.xml?q=gallery%3A'+encodeURIComponent(config.user)+'&type=deviation" | unique(field="title")'),dataType:"jsonp",success:function(resp){var output=[],items,item,i=0,j;if(resp.query&&resp.query.count>0){items=resp.query.results.item;j=items.length;for(;i<j;++i){item=items[i];output.push({date:new Date(item.pubDate),config:config,html:$.tmpl(config.template.deviationpost,{url:item.link,title:item.title})})}}callback(output)}})};$.fn.lifestream.feeds.deviantart.template={deviationpost:'posted <a href="${url}">${title}</a>'};$.fn.lifestream.feeds.dribbble=function(config,callback){var parseDribbbleItem=function(item){var output='posted a shot <a href="'+item.url+'">'+item.title+"</a>";return output};$.ajax({url:"http://api.dribbble.com/players/"+config.user+"/shots",dataType:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.total){j=data.shots.length;for(;i<j;i++){var item=data.shots[i];output.push({date:new Date(item.created_at),config:config,html:parseDribbbleItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.flickr=function(config,callback){var parseFlickrItem=function(item){var output='posted a photo <a href="'+item.link+'">'+item.title+"</a>";return output};$.ajax({url:"http://api.flickr.com/services/feeds/photos_public.gne?id="+config.user+"&lang=en-us&format=json",dataType:"jsonp",jsonp:"jsoncallback",success:function(data){var output=[],i=0,j;if(data&&data.items&&data.items.length>0){j=data.items.length;for(;i<j;i++){var item=data.items[i];output.push({date:new Date(item.published),config:config,html:parseFlickrItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.forrst=function(config,callback){var parseForrstItem=function(item){return"Posted a "+item.post_type+' titled <a href="'+item.post_url+'">'+item.title+"</a>"};$.ajax({url:"http://forrst.com/api/v2/users/posts?username="+config.user+"",dataType:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.resp.length&&data.resp.length>0){j=data.resp.length;for(;i<j;i++){var item=data.resp[i];output.push({date:new Date(item.created_at),config:config,html:parseForrstItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.foursquare=function(config,callback){var parseFoursquareStatus=function(item){var output='checked in @ <a href="'+item.link+'">'+item.title+"</a>";return output},parseFoursquare=function(input){var output=[],i=0,j;if(input.query&&input.query.count&&input.query.count>0){j=input.query.count;for(;i<j;i++){var status=input.query.results.item[i];output.push({date:new Date(status.pubDate),config:config,html:parseFoursquareStatus(status)})}}return output};$.ajax({url:createYqlUrl('select * from rss where url="https://feeds.foursquare.com/history/'+config.user+'.rss"'),dataType:"jsonp",success:function(data){callback(parseFoursquare(data))}})};$.fn.lifestream.feeds.github=function(config,callback){var returnRepo=function(status){return status.payload.repo||status.repository.owner+"/"+status.repository.name},parseGithubStatus=function(status){var output="",name,repo,title,type;if(status.type==="PushEvent"){title="";repo=returnRepo(status);if(status.payload&&status.payload.shas&&status.payload.shas.json&&status.payload.shas.json[2]){title=status.payload.shas.json[2]+" by "+status.payload.shas.json[3]}output+='<a href="'+status.url+'" title="'+title+'">pushed</a> to <a href="http://github.com/'+repo+'">'+repo+"</a>"}else{if(status.type==="GistEvent"){title=status.payload.desc||"";output+=status.payload.action+'d <a href="'+status.payload.url+'" title ="'+title+'">'+status.payload.name+"</a>"}else{if(status.type==="CommitCommentEvent"||status.type==="IssueCommentEvent"){repo=returnRepo(status);output+='<a href="'+status.url+'">commented</a> on <a href="http://github.com/'+repo+'">'+repo+"</a>"}else{if(status.type==="PullRequestEvent"){repo=status.payload.repo||status.repository.owner+"/"+status.repository.name;output+='<a href="'+status.url+'">'+status.payload.action+'</a> pull request on <a href="http://github.com/'+repo+'">'+repo+"</a>"}else{if(status.type==="CreateEvent"&&(status.payload.ref_type==="tag"||status.payload.ref_type==="branch"||status.payload.object==="tag")){repo=returnRepo(status);type=status.payload.ref_type||status.payload.object;name=status.payload.ref||status.payload.object_name;output+="created "+type+' <a href="'+status.url+'">'+name+'</a> for <a href="http://github.com/'+repo+'">'+repo+"</a>"}else{if(status.type==="CreateEvent"){name=(status.payload.object_name==="null")?status.payload.name:status.payload.object_name;output+="created "+status.payload.object+' <a href="'+status.url+'">'+name+"</a>"}else{if(status.type==="DeleteEvent"){output+="deleted "+status.payload.ref_type+' <a href="http://github.com/'+status.repository.owner+"/"+status.repository.name+'">'+status.payload.ref+"</a>"}}}}}}}return output},parseGithub=function(input){var output=[],i=0,j;if(input.query&&input.query.count&&input.query.count>0){j=input.query.count;for(;i<j;i++){var status=input.query.results.json[i].json;output.push({date:new Date(status.created_at),config:config,html:parseGithubStatus(status)})}}return output};$.ajax({url:createYqlUrl('select json.repository.owner,json.repository.name,json.payload,json.type,json.url, json.created_at from json where url="http://github.com/'+config.user+'.json"'),dataType:"jsonp",success:function(data){callback(parseGithub(data))}})};$.fn.lifestream.feeds.googlereader=function(config,callback){var parseReaderEntry=function(entry){return'starred post <a href="'+entry.link.href+'">'+entry.title.content+"</a>"},parseReader=function(input){var output=[],list,i=0,j;if(input.query&&input.query.count&&input.query.count>0){list=input.query.results.feed.entry;j=list.length;for(;i<j;i++){var entry=list[i];output.push({date:new Date(parseInt(entry["crawl-timestamp-msec"],10)),config:config,html:parseReaderEntry(entry)})}}return output};$.ajax({url:createYqlUrl('select * from xml where url="www.google.com/reader/public/atom/user%2F'+config.user+'%2Fstate%2Fcom.google%2Fstarred"'),dataType:"jsonp",success:function(data){callback(parseReader(data))}})};$.fn.lifestream.feeds.iusethis=function(config,callback){var parseIusethis=function(input){var output=[],list,i,j,k,l,m=0,n,item,title,actions,action,what,os,oss=["iPhone","OS X","Windows"];if(input.query&&input.query.count&&input.query.count>0&&input.query.results.rss){n=input.query.results.rss.length;actions=["started using","stopped using","stopped loving","Downloaded","commented on","updated entry for","started loving","registered"],l=actions.length;for(;m<n;m++){os=oss[m];list=input.query.results.rss[m].channel.item;i=0;j=list.length;for(;i<j;i++){item=list[i];title=item.title.replace(config.user+" ","");k=0;for(;k<l;k++){if(title.indexOf(actions[k])>-1){action=actions[k];break}}what=title.split(action);output.push({date:new Date(item.pubDate),config:config,html:action.toLowerCase()+' <a href="'+item.link+'">'+what[1]+"</a> ("+os+")"})}}}return output};$.ajax({url:createYqlUrl('select * from xml where url="http://iphone.iusethis.com/user/feed.rss/'+config.user+'" or url="http://osx.iusethis.com/user/feed.rss/'+config.user+'" or url="http://win.iusethis.com/user/feed.rss/'+config.user+'"'),dataType:"jsonp",success:function(data){callback(parseIusethis(data))}})};$.fn.lifestream.feeds.lastfm=function(config,callback){var parseLastfmEntry=function(entry){var output="";output+='loved <a href="'+entry.url+'">'+entry.name+'</a> by <a href="'+entry.artist.url+'">'+entry.artist.name+"</a>";return output},parseLastfm=function(input){var output=[],list,i=0,j;if(input.query&&input.query.count&&input.query.count>0&&input.query.results.lovedtracks&&input.query.results.lovedtracks.track){list=input.query.results.lovedtracks.track;j=list.length;for(;i<j;i++){var entry=list[i];output.push({date:new Date(parseInt((entry.date.uts*1000),10)),config:config,html:parseLastfmEntry(entry)})}}return output};$.ajax({url:createYqlUrl('select * from xml where url="http://ws.audioscrobbler.com/2.0/user/'+config.user+'/lovedtracks.xml"'),dataType:"jsonp",success:function(data){callback(parseLastfm(data))}})};$.fn.lifestream.feeds.picplz=function(config,callback){var parsePicplzItem=function(item){var imagename=item.caption||item.id;return'Uploaded <a href="'+item.pic_files["640r"].img_url+'">'+imagename+"</a>"};$.ajax({url:"http://picplz.com/api/v2/user.json?username="+config.user+"&include_pics=1",dataType:"jsonp",success:function(data){var output=[],i=0,j,images;images=data.value.users[0].pics;if(images&&images.length&&images.length>0){j=images.length;for(;i<j;i++){var item=images[i];output.push({date:new Date((item.date)*1000),config:config,html:parsePicplzItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.pinboard=function(config,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),config:config,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:'+config.user+'"'),dataType:"jsonp",success:function(data){callback(parsePinboard(data))}})};$.fn.lifestream.feeds.reddit=function(config,callback){var parseRedditItem=function(item){var output="",thread_link="",subreddit_link="http://www.reddit.com/r/"+item.data.subreddit,score=item.data.ups-item.data.downs;score=(score>0)?"+"+score:score;if(item.kind==="t1"){thread_link="http://www.reddit.com/r/"+item.data.subreddit+"/comments/"+item.data.link_id.substring(3)+"/u/"+item.data.name.substring(3)+"?context=3";output+='<a href="'+thread_link+'">commented ('+score+")</a> "}else{if(item.kind==="t3"){output+='<a href="http://www.reddit.com'+item.data.permalink+'">created new thread ('+score+")</a> "}}output+=' in <a href="'+subreddit_link+'">/r/'+item.data.subreddit+"</a>";return output},convertDate=function(date){return new Date(date*1000)};$.ajax({url:"http://www.reddit.com/user/"+config.user+".json",dataType:"jsonp",jsonp:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.data&&data.data.children&&data.data.children.length>0){j=data.data.children.length;for(;i<j;i++){var item=data.data.children[i];output.push({date:convertDate(item.data.created),config:config,html:parseRedditItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.slideshare=function(config,callback){var parseSlideshare=function(input){var output=[],list,i=0,j,item;if(input.query&&input.query.count&&input.query.count>0){list=input.query.results.rss.channel.item;j=list.length;for(;i<j;i++){item=list[i];output.push({date:new Date(item.pubDate),config:config,html:'uploaded a presentation <a href="'+item.link+'">'+item.title+"</a>"})}}return output};$.ajax({url:createYqlUrl('select * from xml where url="http://www.slideshare.net/rss/user/'+config.user+'"'),dataType:"jsonp",success:function(data){callback(parseSlideshare(data))}})};$.fn.lifestream.feeds.stackoverflow=function(config,callback){var parseStackoverflowItem=function(item){var output="",text="",title="",link="",stackoverflow_link="http://stackoverflow.com/users/"+config.user,question_link="http://stackoverflow.com/questions/";if(item.timeline_type==="badge"){text=item.timeline_type+" "+item.action+": "+item.description;title=item.detail;link=stackoverflow_link+"?tab=reputation"}else{if(item.timeline_type==="revision"||item.timeline_type==="comment"||item.timeline_type==="accepted"||item.timeline_type==="askoranswered"){text=item.post_type+" "+item.action;title=item.detail||item.description||"";link=question_link+item.post_id}}output+='<a href="'+link+'" title="'+title+'">'+text+"</a> - "+title;return output},convertDate=function(date){return new Date(date*1000)};$.ajax({url:"http://api.stackoverflow.com/1.1/users/"+config.user+"/timeline?jsonp",dataType:"jsonp",jsonp:"jsonp",success:function(data){var output=[],i=0,j;if(data&&data.total&&data.total>0&&data.user_timelines){j=data.user_timelines.length;for(;i<j;i++){var item=data.user_timelines[i];output.push({date:convertDate(item.creation_date),config:config,html:parseStackoverflowItem(item)})}}callback(output)}})};$.fn.lifestream.feeds.tumblr=function(config,callback){var getTitle=function(post){var title=post["regular-title"]||post["quote-text"]||post["conversation-title"]||post["photo-caption"]||post["video-caption"]||post["audio-caption"]||post["regular-body"]||post["link-text"]||post.type||"";return title.replace(/\<.+?\>/gi," ")},createTumblrOutput=function(config,post){return{date:new Date(post.date),config:config,html:"posted a "+post.type+' <a href="'+post.url+'">'+getTitle(post)+"</a>"}},parseTumblr=function(input){var output=[],i=0,j,post;if(input.query&&input.query.count&&input.query.count>0){if($.isArray(input.query.results.posts.post)){j=input.query.results.posts.post.length;for(;i<j;i++){post=input.query.results.posts.post[i];output.push(createTumblrOutput(config,post))}}else{if($.isPlainObject(input.query.results.posts.post)){output.push(createTumblrOutput(config,input.query.results.posts.post))}}}return output};$.ajax({url:createYqlUrl('select * from tumblr.posts where username="'+config.user+'"'),dataType:"jsonp",success:function(data){callback(parseTumblr(data))}})};$.fn.lifestream.feeds.twitter=function(config,callback){var addTwitterLinks=function(tweet){return $.fn.lifestream.linkify(tweet).replace(/ #([A-Za-z0-9\/\.]*)/g,function(m){return' <a target="_new" href="http://twitter.com/search?q='+m.replace(" #","%23")+'">'+m+"</a>"}).replace(/@[\w]+/g,function(m){return'<a href="http://www.twitter.com/'+m.replace("@","")+'">'+m+"</a>"})},parseTwitter=function(input){var output=[],i=0,j;if(input.query&&input.query.count&&input.query.count>0){j=input.query.count;for(;i<j;i++){var status=input.query.results.statuses[i].status;output.push({date:new Date(status.created_at),config:config,html:addTwitterLinks(status.text)})}}return output};$.ajax({url:createYqlUrl('select status.id, status.created_at, status.text from twitter.user.timeline where screen_name="'+config.user+'"'),dataType:"jsonp",success:function(data){callback(parseTwitter(data))}})};$.fn.lifestream.feeds.vimeo=function(config,callback){var parseVimeoItem=function(item){return'published a video <a href="'+item.url+'" title="'+item.description.replace(/"/g,"'").replace(/\<.+?\>/gi,"")+'">'+item.title+"</a>"},parseVimeo=function(input){var output=[],i=0,j,item;if(input){j=input.length;for(;i<j;i++){item=input[i];output.push({date:new Date(item.upload_date),config:config,html:parseVimeoItem(item)})}}return output};$.ajax({url:"http://vimeo.com/api/v2/"+config.user+"/videos.json",dataType:"jsonp",crossDomain:true,success:function(data){callback(parseVimeo(data))}})};$.fn.lifestream.feeds.youtube=function(config,callback){var parseYoutubeItem=function(item){return' favorited <a href="'+item.video.player["default"]+'" title="'+item.video.description+'">'+item.video.title+"</a>"},parseYoutube=function(input){var output=[],i=0,j,item;if(input.data&&input.data.items){j=input.data.items.length;for(;i<j;i++){item=input.data.items[i];output.push({date:new Date(item.created),config:config,html:parseYoutubeItem(item)})}}return output};$.ajax({url:"http://gdata.youtube.com/feeds/api/users/"+config.user+"/favorites?v=2&alt=jsonc",dataType:"jsonp",success:function(data){callback(parseYoutube(data))}})}}(jQuery));
View
86 template.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="description" content="The jQuery Lifestream plug-in enables you to show a stream of your online activity. On this page you can check out the examples">
+ <meta name="keywords" content="jQuery, plugin, lifestream, jquery-lifestream, twitter, delicious, github, stackoverflow, flickr, lastfm, youtube">
+
+ <title>jQuery Lifestream example</title>
+
+ <style type="text/css">
+ body {
+ margin: 1.0em;
+ background-color: #fff;
+ font-family: Helvetica, Arial, FreeSans, sans-serif;
+ color: #000000;
+ }
+ h1 { font-size: 3.8em; color: #3908bc; margin-bottom: 3px; }
+ h1 .small { font-size: 0.4em; }
+ h1 a { text-decoration: none }
+ h2 { font-size: 1.5em; color: #3908bc; clear: both;}
+ h3 { text-align: center; color: #3908bc; }
+ a { color: #3908bc; }
+ ul li { list-style-type: none;}
+
+ .fadeout {color: #999;}
+ </style>
+ <link href="css/lifestream.css" rel="stylesheet" type="text/css">
+ <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
+</head>
+<body>
+ <a href="http://github.com/christianv/jquery-lifestream">
+ <img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
+ </a>
+ <h1>jQuery Lifestream Templates</h1>
+ <p>Find more information about this plug-in on the <a href="http://github.com/christianv/jquery-lifestream">project page</a>.</p>
+ <p>Go ahead and <a href="http://christianv.github.com/jquery-lifestream/me/">create your own lifestream</a>.</p>
+
+ <h2>Currently supported templates:</h2>
+ <div id="tempates"></div>
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
+ <script>!window.jQuery && document.write('<script src="http://code.jquery.com/jquery-1.6.1.min.js"><\/script>');</script>
+ <script src="jquery.lifestream.js" type="text/javascript" charset="utf-8"></script>
+ <script>
+ var $templates = $("#tempates"),
+ output=$('<ul>'), listitem, count, template, templateitems;
+ for(var i in $.fn.lifestream.feeds){
+ if($.fn.lifestream.feeds.hasOwnProperty(i)){
+ listitem = $('<li>');
+ count = 0;
+ listitem.append(i);
+ template = $.fn.lifestream.feeds[i].template;
+ if(template) {
+ templateitems = $('<ul>');
+ for(var j in template){
+ if(template.hasOwnProperty(j)){
+ console.log(template[j]);
+ templateitem = $('<li>');
+ templateitem.append(j + ": <br />");
+ var code = $("<code><pre>t");
+ templateitem.append(code.text(template[j]));
+ templateitems.append(templateitem);
+ count++;
+ }
+ }
+ listitem.append(' <span class="fadeout">(' + count + ')</span>');
+ listitem.append(templateitems);
+ }
+ else {
+ listitem.append(' <span class="fadeout">(' + count + ')</span>');
+ }
+ }
+ output.append(listitem);
+ }
+ $templates.html(output);
+ </script>
+
+ <script>
+ var _gaq=[["_setAccount","UA-190225-11"],["_trackPageview"],["_trackPageLoadTime"]];
+ (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
+ g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
+ s.parentNode.insertBefore(g,s)}(document,"script"));
+ </script>
+
+</body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.