$.getJSON("js/settings.json",function(a){document.title=a.name+"'s Profile";$("#intro").before("<h1>"+a.name+"'s profile</h1>");$.each(a.services,function(b,c){switch(b){case"gravatar":if("undefined"!=typeof(c.id)&&c.id.length>0){if(c.id.length>40){c.id=c.id.substr(31,40)}$("head").append('<link rel="shortcut icon" href="http://gravatar.com/avatar/'+c.id+'.jpg?d=404&s=48"><link rel="apple-touch-icon" href="http://gravatar.com/avatar/'+c.id+'.jpg?d=404&s=114">');$("#intro").before('<img src="http://gravatar.com/avatar/'+c.id+'.jpg?d=404&s=200" alt="" class="avatar" />')}break;case"diaspora":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=94ace3e6f2dc55156d6a3012d772dc99&_render=json&feed=https%3A%2F%2Fjoindiaspora.com%2Fpublic%2F"+c.username+".atom",function(d){if("undefined"==typeof(d.value.items[0])){console.warn("Diaspora: %s has no public posts",c.username);return}$("header").append('<blockquote cite="https://joindiaspora.com/public/'+c.username+'.atom">'+d.value.items[0].content+'<footer><a href="https://joindiaspora.com/public/'+c.username+'.atom" title="View my Diaspora public feed" class="viewProfile">My public Diaspora posts</a></footer></blockquote>')})}break;case"identica":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://identi.ca/api/statuses/user_timeline.json?count=1&screen_name="+c.username+"&callback=?",function(d){if("undefined"==typeof(d[0])){console.warn("Identi.ca: %s has no public dents",c.username);return}$("header").append('<blockquote cite="http://identi.ca/'+d[0].user.screen_name+'">'+d[0].text+'<footer><a href="http://identi.ca/'+d[0].user.screen_name+'" title="View my Identi.ca profile" class="viewProfile">My Identi.ca profile</a></footer></blockquote>')})}break;case"twitter":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?count=1&screen_name="+c.username+"&callback=?",function(d){if("undefined"==typeof(d[0])){console.warn("Twitter: %s has no public tweets",c.username);return}$("header").append('<blockquote cite="http://twitter.com/'+d[0].user.screen_name+'">'+d[0].text+'<footer><a href="http://twitter.com/'+d[0].user.screen_name+'" title="View my Twitter profile" class="viewProfile">My Twitter profile</a></footer></blockquote>')})}break;case"delicious":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://feeds.delicious.com/v2/json/"+c.username+"?count=5&callback=?",function(e){if("undefined"==typeof(e[0])){console.warn("Delicious: %s has no public bookmarks",c.username);return}latestBookmarks='<article id="delicious"><h2>Latest bookmarks</h2><ul>';for(var d in e){if(5==d){break}latestBookmarks+='<li><a href="'+e[d].u+'" title="View this bookmark">'+e[d].d+"</a></li>"}latestBookmarks+='</ul><footer><a href="http://www.delicious.com/'+c.username+'" title="View my Delicious profile">My Delicious profile</a class="viewProfile"></footer></article>';$("#main").append(latestBookmarks)})}break;case"freelish":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://freelish.us/api/statuses/user_timeline.json?count=5&screen_name="+c.username+"&callback=?",function(e){if("undefined"==typeof(e[0])){console.warn("Freelish: %s has no public bookmarks",c.username);return}sharedLinks='<article id="freelish"><h2>Latest links</h2><ul>';for(var d in e){if(5==d){break}sharedLinks+="<li>"+e[d].statusnet_html+"</li>"}sharedLinks+='</ul><footer><a href="http://freelish.us/'+c.username+'" title="View my freelish.us profile" class="viewProfile">My freelish.us profile</a></footer></article>';$("#main").append(sharedLinks)})}break;case"goodreads":if("undefined"!=typeof(c.id)&&c.id.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=4a47fdbfda58f3ee15986c902dbe5c30&_render=json&url=http%3A%2F%2Fwww.goodreads.com%2Freview%2Flist%2F"+c.id+".xml%3Fkey%3DbzTGFjoYxZfmYoquLEHMw%26v%3D2%26shelf%3Dread%26per_page%3D3%26sort%3Ddate_read%26order%3Dd",function(e){if("undefined"==typeof(e.value.items[0].reviews.review[0])){console.warn("Goodreads: %s has no public reviews",c.id);return}lastRead='<article id="goodreads"><h2>Last read</h2>';for(var d in e.value.items[0].reviews.review){lastRead+='<figure><a href="'+e.value.items[0].reviews.review[d].url+'" title="View this book on Goodreads"><img src="'+e.value.items[0].reviews.review[d].book.image_url+'" alt="" /></a><figcaption><a href="'+e.value.items[0].reviews.review[d].url+'" title="View this book on Goodreads">'+e.value.items[0].reviews.review[d].book.title+"</a></figcaption></figure>"}lastRead+='<footer><a href="http://www.goodreads.com/user/show/'+c.id+'" title="View my Goodreads profile">My Goodreads profile</a class="viewProfile"></footer></article>';$("#main").append(lastRead)})}break;case"jamendo":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://api.jamendo.com/get2/id+name+url+image+artist_name/album/json/album_user_starred/?user_idstr="+c.username+"&n=3&order=starreddate_desc",function(e){if("undefined"==typeof(e[0])){console.warn("Jamendo: %s has not favourited albums",c.username);return}sharedLinks='<article id="jamendo"><h2>Recently favourited albums</h2>';for(var d in e){if(3==d){break}sharedLinks+='<figure><a href="'+e[d].url+'" title="View '+e[d].artist_name+" - "+e[d].name+' on Jamendo"><img src="'+e[d].image+'" /></a><figcaption><a href="'+e[d].url+'" title="View '+e[d].artist_name+" - "+e[d].name+' on Jamendo">'+e[d].name+"</figcaption></a></figure>"}sharedLinks+='<footer><a href="http://www.jamendo.com/user/'+c.username+'" title="View my Jamendo profile" class="viewProfile">My Jamendo profile</a></footer></article>';$("#main").append(sharedLinks)})}break;case"librefm":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://alpha.libre.fm/2.0/?method=user.gettoptracks&user="+c.username+"&period=3month&format=json&callback=?",function(e){if("undefined"==typeof(e.toptracks.track)){console.warn("Libre.fm: %s has no top tracks",c.username);return}toptracks='<article id="librefm"><h2>Favourite songs</h2><ol>';for(var d in e.toptracks.track){if(5==d){break}toptracks+='<li><a href="'+e.toptracks.track[d].url+'" title="View this song on Libre.fm">'+e.toptracks.track[d].artist.name+" - "+e.toptracks.track[d].name+"</a></li>"}toptracks+='</ol><footer><a href="http://libre.fm/user/'+c.username+'" title="View my Libre.fm profile" class="viewProfile">My Libre.fm profile</a></footer></article>';$("#main").append(toptracks)})}break;case"lastfm":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user="+c.username+"&api_key=3578c376cbe926fdf8aecc97fa8eed27&limit=5&period=3month&format=json&callback=?",function(e){if("undefined"==typeof(e.toptracks.track)){console.warn("Last.fm: %s has no top tracks",c.username);return}toptracks='<article id="lastfm"><h2>Favourite songs</h2><ol>';for(var d in e.toptracks.track){toptracks+='<li><a href="'+e.toptracks.track[d].url+'" title="View this song on Last.fm">'+e.toptracks.track[d].artist.name+" - "+e.toptracks.track[d].name+"</a></li>"}toptracks+='</ol><footer><a href="http://www.last.fm/user/'+c.username+'" title="View my Last.fm profile" class="viewProfile">My Last.fm profile</a></footer></article>';$("#main").append(toptracks)})}break;case"flickr":if("undefined"!=typeof(c.id)&&c.id.length>0){$.getJSON("http://api.flickr.com/services/rest/?format=json&method=flickr.people.getPublicPhotos&api_key=44f7f1d9a3acef2569b8addc0f933243&per_page=3&extras=url_t&user_id="+c.id+"&jsoncallback=?",function(e){if("undefined"==typeof(e.photos.photo[0])){console.warn("Flickr: this user has no public photos");return}latestPhotos='<article id="flickr"><h2>Latest photos</h2>';for(var d in e.photos.photo){if(3==d){break}latestPhotos+='<a href="http://www.flickr.com/photos/'+c.id+"/"+e.photos.photo[d].id+'/in/photostream" title="View this photo on Flickr"><img src="'+e.photos.photo[d].url_t+'" /></a>'}latestPhotos+='<footer><a href="http://www.flickr.com/photos/'+c.id+'" title="View my Flickr profile" class="viewProfile">My Flickr profile</a></footer></article>';$("#main").append(latestPhotos)})}break;case"picasa":if("undefined"!=typeof(c.id)&&c.id.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=4a47fdbfda58f3ee15986c902dbe5c30&_render=json&url=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F"+c.id+"%3Fkind%3Dphoto%26max-results%3D3%26thumbsize%3D104%26kind%3Dphoto",function(d){if("undefined"==typeof(d.value.items[0].entry[0])){console.warn("Picasa: this user has no public photos");return}latestPhotos='<article id="picasa"><h2>Latest photos</h2><a href="'+d.value.items[0].entry[0].link[2].href+'" title="View this photo on Picasa"><img src="'+d.value.items[0].entry[0]["media:group"]["media:thumbnail"].url+'" /></a>';if("undefined"!=typeof(d.value.items[0].entry[1])){latestPhotos+='<a href="'+d.value.items[0].entry[1].link[2].href+'" title="View this photo on Picasa"><img src="'+d.value.items[0].entry[1]["media:group"]["media:thumbnail"].url+'" /></a>'}if("undefined"!=typeof(d.value.items[0].entry[2])){latestPhotos+='<a href="'+d.value.items[0].entry[2].link[2].href+'" title="View this photo on Picasa"><img src="'+d.value.items[0].entry[2]["media:group"]["media:thumbnail"].url+'" /></a>'}latestPhotos+='<footer><a href="https://picasaweb.google.com/'+c.id+'" title="View my Picasa profile" class="viewProfile">My Picasa profile</a></footer></article>';$("#main").append(latestPhotos)})}break;case"23":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=94ace3e6f2dc55156d6a3012d772dc99&_render=json&feed=http%3A%2F%2Fwww.23hq.com%2Frss%2F"+c.username,function(d){if("undefined"==typeof(d.value.items[0])){console.warn("23: %s has no public photos",c.username);return}latestPhotos='<article id="23"><h2>Latest photos</h2><a href="'+d.value.items[0].link+'" title="View this photo on 23hq.com"><img src="'+d.value.items[0]["media:thumbnail"].url+'" /></a>';if("undefined"!=typeof(d.value.items[1])){latestPhotos+='<a href="'+d.value.items[1].link+'" title="View this photo on 23hq.com"><img src="'+d.value.items[1]["media:thumbnail"].url+'" /></a>'}latestPhotos+='<footer><a href="http://23hq.com/'+c.username+'" title="View my 23 profile" class="viewProfile">My 23 profile</a></footer></article>';$("#main").append(latestPhotos)})}break;case"googlereader":if("undefined"!=typeof(c.id)&&c.id.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=94ace3e6f2dc55156d6a3012d772dc99&_render=json&feed=http%3A%2F%2Fwww.google.com%2Freader%2Fpublic%2Fatom%2Fuser%252F"+c.id+"%252Fstate%252Fcom.google%252Fbroadcast",function(e){if("undefined"==typeof(e.value.items[0])){console.warn("Google Reader: this user has no publicly shared items");return}sharedLinks='<article id="googlereader"><h2>Shared links</h2><ul>';for(var d in e.value.items){if(5==d){break}sharedLinks+='<li><a href="'+e.value.items[d].link+'" title="View this story">'+e.value.items[d].title+"</li>"}sharedLinks+='</ul><footer><a href="http://www.google.com/reader/shared/'+c.id+'" title="View my Google Reader profile" class="viewProfile">My Google Reader profile</a></footer></article>';$("#main").append(sharedLinks)})}break;case"reddit":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://www.reddit.com/user/"+c.username+"/liked/.json?jsonp=?",function(e){if("undefined"==typeof(e.data.children[0])){console.warn("Reddit: %s has no public upvotes",c.username);return}sharedLinks='<article id="reddit"><h2>Upvoted on Reddit</h2><ul>';for(var d in e.data.children){if(5==d){break}sharedLinks+='<li><a href="'+e.data.children[d].data.url+'" title="View this story">'+e.data.children[d].data.title+"</li>"}sharedLinks+='</ul><footer><a href="http://www.reddit.com/user/'+c.username+'" title="View my Reddit profile" class="viewProfile">My Reddit profile</a></footer></article>';$("#main").append(sharedLinks)})}break;case"gitorious":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=94ace3e6f2dc55156d6a3012d772dc99&_render=json&feed=https%3A%2F%2Fgitorious.org%2F%7E"+c.username+"%2Ffeed.atom",function(e){if("undefined"==typeof(e.value.items[0])){console.warn("Gitorious: %s has no public development activity",c.username);return}activity='<article id="gitorious"><h2>Latest development activity</h2><ul>';for(var d in e.value.items){if(5==d){break}activity+="<li>"+e.value.items[d].title+"</li>"}activity+='</ul><footer><a href="https://gitorious.org/~'+c.username+'" title="View my Gitorious profile" class="viewProfile">My Gitorious profile</a></footer></article>';$("#main").append(activity)})}break;case"github":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=94ace3e6f2dc55156d6a3012d772dc99&_render=json&feed=https%3A%2F%2Fgithub.com%2F"+c.username+".atom",function(e){if("undefined"==typeof(e.value.items[0])){console.warn("GitHub: %s has no public development activity",c.username);return}activity='<article id="github"><h2>Latest development activity</h2><ul>';for(var d in e.value.items){if(5==d){break}activity+='<li><a href="'+e.value.items[d].link+'" title="View this activity">'+e.value.items[d].title+"</a></li>"}activity+='</ul><footer><a href="https://github.com/'+c.username+'" title="View my GitHub profile" class="viewProfile">My GitHub profile</a></footer></article>';$("#main").append(activity)})}break;case"launchpad":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=94ace3e6f2dc55156d6a3012d772dc99&_render=json&feed=http%3A%2F%2Ffeeds.launchpad.net%2F%7E"+c.username+"%2Frevisions.atom",function(e){if("undefined"==typeof(e.value.items[0])){console.warn("Launchpad: %s has no public commits",c.username);return}activity='<article id="launchpad"><h2>Latest development activity</h2><ul>';for(var d in e.value.items){if(5==d){break}activity+="<li>"+e.value.items[d].title+"</li>"}activity+='</ul><footer><a href="https://launchpad.net/'+c.username+'" title="View my Launchpad profile" class="viewProfile">My Launchpad profile</a></footer></article>';$("#main").append(activity)})}break;case"vimeo":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://vimeo.com/api/v2/"+c.username+"/videos.json?callback=?",function(e){if("undefined"==typeof(e[0])){console.warn("Vimeo: %s has no public videos",c.username);return}sharedLinks='<article id="vimeo"><h2>Latest videos</h2>';for(var d in e){if(3==d){break}sharedLinks+='<figure><a href="'+e[d].url+'" title="View '+e[d].title+' on Vimeo"><img src="'+e[d].thumbnail_small+'" /></a><figcaption><a href="'+e[d].url+'" title="View '+e[d].title+' on Vimeo">'+e[d].title+"</figcaption></a></figure>"}sharedLinks+='<footer><a href="'+e[0].user_url+'" title="View my Vimeo profile" class="viewProfile">My Vimeo profile</a></footer></article>';$("#main").append(sharedLinks)})}break;case"youtube":if("undefined"!=typeof(c.username)&&c.username.length>0){$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=4a47fdbfda58f3ee15986c902dbe5c30&_render=json&url=http%3A%2F%2Fgdata.youtube.com%2Ffeeds%2Fapi%2Fusers%2F"+c.username+"%2Ffavorites%3Fv%3D2%26max-results%3D3",function(e){if("undefined"==typeof(e.value.items[0].entry[0])){console.warn("YouTube: %s has no publicly favourited videos",c.username);return}sharedLinks='<article id="youtube"><h2>Favourite videos</h2>';for(var d in e.value.items[0].entry){if(3==d){break}sharedLinks+='<figure><a href="'+e.value.items[0].entry[d].link[0].href+'" title="View '+e.value.items[0].entry[d].title+' on YouTube"><img src="'+e.value.items[0].entry[d]["media:group"]["media:thumbnail"][0].url+'" /></a><figcaption><a href="'+e.value.items[0].entry[d].link[0].href+'" title="View '+e.value.items[0].entry[d].title+' on YouTube">'+e.value.items[0].entry[d].title+"</figcaption></a></figure>"}sharedLinks+='<footer><a href="http://www.youtube.com/user/'+c.username+'" title="View my YouTube profile" class="viewProfile">My YouTube profile</a></footer></article>';$("#main").append(sharedLinks)})}break}})});
