Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added github gists

  • Loading branch information...
commit 9d65b37a7917ea31f78c93dcd60b96bbc2c97254 1 parent 31d47de
@msoap authored
Showing with 32 additions and 2 deletions.
  1. +31 −1 js/script.js
  2. +1 −1  js/script.min.js
View
32 js/script.js
@@ -15,6 +15,7 @@ var App = {
// render
App.on_init_render_github();
App.on_init_render_delicious();
+ App.on_init_render_github_gists();
App.on_init_render_lastfm();
App.on_init_render_fotkiyandexru();
App.on_init_render_twitter();
@@ -44,7 +45,7 @@ var App = {
var vars = {
name: 'Github repositories:',
- link_to_all: 'http://github.com/msoap',
+ link_to_all: 'https://github.com/msoap',
items: github_data.data.map(function(i) {
var urls = [];
@@ -69,6 +70,35 @@ var App = {
});
},
+ on_init_render_github_gists: function() {
+ // http://developer.github.com/v3/gists/
+ // https://api.github.com/users/msoap/gists
+ $.getJSON("https://api.github.com/users/msoap/gists?callback=?", {
+ "format": "json"
+ }, function(github_gists_data) {
+
+ var vars = {
+ name: 'Github gists:',
+ link_to_all: 'https://gist.github.com/msoap',
+ items: github_gists_data.data.map(function(i) {
+ var file_name = i.description;
+ for (var key in i.files) {
+ file_name = key + "" + i.description;
+ break;
+ }
+ return {
+ title: file_name,
+ description: i.description,
+ url: i.html_url,
+ date: new Date(i.updated_at).toLocaleDateString()
+ };
+ })
+ };
+
+ App.render_any('div#github', vars);
+ });
+ },
+
on_init_render_delicious: function() {
// http://delicious.com/developers
$.getJSON("http://feeds.delicious.com/v2/json/msoap?callback=?", {
View
2  js/script.min.js
@@ -1 +1 @@
-"use strict";$(function(){App.init()});var App={init:function(){$("div#navbar ul.nav li a").click(App.on_click_navbar),setTimeout(App.on_init_set_active,10),App.on_init_render_github(),App.on_init_render_delicious(),App.on_init_render_lastfm(),App.on_init_render_fotkiyandexru(),App.on_init_render_twitter(),App.on_init_render_linkedin()},on_init_set_active:function(){var e=document.location.hash.replace(/^#/,"");e.length&&$("div#"+e).length&&($("div#navbar ul.nav li").removeClass("active"),$("div#navbar ul.nav li a[href=#"+e+"]").parent("li").addClass("active"))},on_click_navbar:function(){$(this).parents("ul").find("li").removeClass("active"),$(this).parent("li").addClass("active")},on_init_render_github:function(){$.getJSON("https://api.github.com/users/msoap/repos?callback=?",{format:"json"},function(e){var t={name:"Github repositories:",link_to_all:"http://github.com/msoap",items:e.data.map(function(e){var t=[];return e.homepage&&e.homepage.length&&t.push({title:"home",url:e.homepage}),t.push({title:"repository",url:e.html_url}),e.has_wiki&&t.push({title:"wiki",url:e.html_url+"/wiki"}),{title:e.description,description:e.description,urls:t,date:(new Date(e.updated_at)).toLocaleDateString()}})};App.render_any("div#github",t,"script#tmpl_links_block_github")})},on_init_render_delicious:function(){$.getJSON("http://feeds.delicious.com/v2/json/msoap?callback=?",{},function(e){var t={name:"Last delicious links:",link_to_all:"http://delicious.com/msoap",items:e.map(function(e){return{title:e.d,description:e.n,url:e.u,date:(new Date(e.dt)).toLocaleDateString()}})};App.render_any("div#delicious",t)})},on_init_render_lastfm:function(){$.getJSON("http://ws.audioscrobbler.com/2.0/?callback=?",{method:"user.getRecentTracks",format:"json",user:"msoap",api_key:"f013c46eeee32be481c90eb2c79378c5"},function(e){var t={without_url:!0,name:"Recently Listened Tracks:",link_to_all:"http://www.lastfm.ru/user/msoap",items:e.recenttracks.track.map(function(e){return{title:e.name,description:[e.artist["#text"],e.album["#text"]].join(" / "),url:e.url,date:e.date?(new Date(e.date.uts*1e3)).toLocaleDateString():(new Date).toLocaleDateString()}})};App.render_any("div#lastfm",t)})},on_init_render_fotkiyandexru:function(){$.getJSON("http://api-fotki.yandex.ru/api/users/msoap/photos/?callback=?",{limit:10,format:"json"},function(e){var t={without_url:!0,name:"Last photos:",link_to_all:"http://fotki.yandex.ru/users/msoap/",items:e.entries.filter(function(e,t){return t<15?!0:!1}).map(function(e){return{title:e.title,description:e.description,url:e.links.alternate,date:(new Date(e.published)).toLocaleDateString()}})};App.render_any("div#fotkiyandexru",t)})},on_init_render_twitter:function(){$.getJSON("https://api.twitter.com/1/statuses/user_timeline.json?callback=?",{include_entities:"false",include_rts:"false",screen_name:"msoap",count:10},function(e){var t={without_url:!0,name:"Last twits, one twit per year:)",link_to_all:"http://twitter.com/msoap",items:e.map(function(e){return{title:e.text,description:"",url:"http://twitter.com/#!/msoap/status/"+e.id_str,date:(new Date(e.created_at)).toLocaleDateString()}})};App.render_any("div#twitter",t)})},on_init_render_linkedin:function(){$("div#linkedin_div").append('<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/MemberProfile" data-id="http://www.linkedin.com/in/mudrik" data-format="click" data-related="false"></script>'),$("div#linkedin_div").one("mouseenter mouseleave",function(){$("span.IN-widget a.li-connect-link").append('<span style="color: black; font-size: 70%; text-decoration: none;">Linkedin<span>'),$(this).unbind("mouseenter mouseleave")})},render_any:function(e,t,n){n||(n="script#tmpl_links_block"),$(n).tmpl(t).appendTo(e)}};
+"use strict";$(function(){App.init()});var App={init:function(){$("div#navbar ul.nav li a").click(App.on_click_navbar),setTimeout(App.on_init_set_active,10),App.on_init_render_github(),App.on_init_render_delicious(),App.on_init_render_github_gists(),App.on_init_render_lastfm(),App.on_init_render_fotkiyandexru(),App.on_init_render_twitter(),App.on_init_render_linkedin()},on_init_set_active:function(){var e=document.location.hash.replace(/^#/,"");e.length&&$("div#"+e).length&&($("div#navbar ul.nav li").removeClass("active"),$("div#navbar ul.nav li a[href=#"+e+"]").parent("li").addClass("active"))},on_click_navbar:function(){$(this).parents("ul").find("li").removeClass("active"),$(this).parent("li").addClass("active")},on_init_render_github:function(){$.getJSON("https://api.github.com/users/msoap/repos?callback=?",{format:"json"},function(e){var t={name:"Github repositories:",link_to_all:"https://github.com/msoap",items:e.data.map(function(e){var t=[];return e.homepage&&e.homepage.length&&t.push({title:"home",url:e.homepage}),t.push({title:"repository",url:e.html_url}),e.has_wiki&&t.push({title:"wiki",url:e.html_url+"/wiki"}),{title:e.description,description:e.description,urls:t,date:(new Date(e.updated_at)).toLocaleDateString()}})};App.render_any("div#github",t,"script#tmpl_links_block_github")})},on_init_render_github_gists:function(){$.getJSON("https://api.github.com/users/msoap/gists?callback=?",{format:"json"},function(e){var t={name:"Github gists:",link_to_all:"https://gist.github.com/msoap",items:e.data.map(function(e){var t=e.description;for(var n in e.files){t=n+" — "+e.description;break}return{title:t,description:e.description,url:e.html_url,date:(new Date(e.updated_at)).toLocaleDateString()}})};App.render_any("div#github",t)})},on_init_render_delicious:function(){$.getJSON("http://feeds.delicious.com/v2/json/msoap?callback=?",{},function(e){var t={name:"Last delicious links:",link_to_all:"http://delicious.com/msoap",items:e.map(function(e){return{title:e.d,description:e.n,url:e.u,date:(new Date(e.dt)).toLocaleDateString()}})};App.render_any("div#delicious",t)})},on_init_render_lastfm:function(){$.getJSON("http://ws.audioscrobbler.com/2.0/?callback=?",{method:"user.getRecentTracks",format:"json",user:"msoap",api_key:"f013c46eeee32be481c90eb2c79378c5"},function(e){var t={without_url:!0,name:"Recently Listened Tracks:",link_to_all:"http://www.lastfm.ru/user/msoap",items:e.recenttracks.track.map(function(e){return{title:e.name,description:[e.artist["#text"],e.album["#text"]].join(" / "),url:e.url,date:e.date?(new Date(e.date.uts*1e3)).toLocaleDateString():(new Date).toLocaleDateString()}})};App.render_any("div#lastfm",t)})},on_init_render_fotkiyandexru:function(){$.getJSON("http://api-fotki.yandex.ru/api/users/msoap/photos/?callback=?",{limit:10,format:"json"},function(e){var t={without_url:!0,name:"Last photos:",link_to_all:"http://fotki.yandex.ru/users/msoap/",items:e.entries.filter(function(e,t){return t<15?!0:!1}).map(function(e){return{title:e.title,description:e.description,url:e.links.alternate,date:(new Date(e.published)).toLocaleDateString()}})};App.render_any("div#fotkiyandexru",t)})},on_init_render_twitter:function(){$.getJSON("https://api.twitter.com/1/statuses/user_timeline.json?callback=?",{include_entities:"false",include_rts:"false",screen_name:"msoap",count:10},function(e){var t={without_url:!0,name:"Last twits, one twit per year:)",link_to_all:"http://twitter.com/msoap",items:e.map(function(e){return{title:e.text,description:"",url:"http://twitter.com/#!/msoap/status/"+e.id_str,date:(new Date(e.created_at)).toLocaleDateString()}})};App.render_any("div#twitter",t)})},on_init_render_linkedin:function(){$("div#linkedin_div").append('<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/MemberProfile" data-id="http://www.linkedin.com/in/mudrik" data-format="click" data-related="false"></script>'),$("div#linkedin_div").one("mouseenter mouseleave",function(){$("span.IN-widget a.li-connect-link").append('<span style="color: black; font-size: 70%; text-decoration: none;">Linkedin<span>'),$(this).unbind("mouseenter mouseleave")})},render_any:function(e,t,n){n||(n="script#tmpl_links_block"),$(n).tmpl(t).appendTo(e)}};
Please sign in to comment.
Something went wrong with that request. Please try again.