Skip to content

Instantly share code, notes, and snippets.

@henriquegogo
Created June 8, 2011 12:08
Show Gist options
  • Save henriquegogo/1014293 to your computer and use it in GitHub Desktop.
Save henriquegogo/1014293 to your computer and use it in GitHub Desktop.
Script code from Gogs.com.br
google.load("feeds", "1");
var user = {};
user.gravatar = "943753a9af1bd4a2f6466875ac5efccd";
user.contato = "https://spreadsheets.google.com/viewform?formkey=dHVobnA4dkc1cm1fcjlFWGJYSXJJUUE6MQ&ifq";
user.aboutme = "henriquegogo";
user.twitter = "henriquegogo";
user.facebook = "henriquegogo";
user.orkut = "10554372327654343666";
user.youtube = "henriquegogo";
user.github = "henriquegogo";
user.flickr = {};
user.flickr.self = "34052227@N06";
user.flickr.tag = "portifolio";
user.delicious = {};
user.delicious.self = "henriquegogo";
user.delicious.tag = "byme";
user.feed = "http://blog.gogs.com.br/rss";
user.slideshare = "henriquegogo";
user.gist = "henriquegogo";
user.twitpic = "henriquegogo";
user.lastfm = "henriquegogo";
$(document).ready(function() {
// GRAVATAR
$.getJSON("http://gravatar.com/" + user.gravatar + ".json?callback=?", function(json) {
$('#avatar').attr('src', json.entry[0].thumbnailUrl + '?size=80');
});
// ICONES
$('#aboutme_ico').attr('href', 'http://about.me/' + user.aboutme);
$('#twitter_ico').attr('href', 'http://twitter.com/' + user.twitter);
$('#facebook_ico').attr('href', 'http://facebook.com/' + user.facebook);
$('#orkut_ico').attr('href', 'http://www.orkut.com.br/Main#Profile?uid=' + user.orkut);
$('#youtube_ico').attr('href', 'http://youtube.com/' + user.youtube);
$('#contato_ico').attr('href', user.contato);
$('#contato').attr('href', user.contato);
// TWITTER
$.getJSON("http://twitter.com/status/user_timeline/" + user.twitter + ".json?callback=?", function(json) {
document.title = json[0].user.description + " - " + json[0].user.name;
$('#nome').html(json[0].user.name);
$('#site').html(json[0].user.url);
$('#site').attr('href', json[0].user.url);
$('#descricao').html(json[0].user.description);
$.each(json, function(i, tweet) {
if (!tweet.text.match("@") && $("#twitter i").html() == "Carregando...") {
$('#twitter i').html('"' + tweet.text + '"');
$('#twitter a').html("@" + tweet.user.screen_name);
$('#twitter a').attr("href", "http://twitter.com/" + user.twitter);
}
});
});
// YOUTUBE
$.getJSON("http://gdata.youtube.com/feeds/api/users/" + user.youtube + "/uploads?v=2&alt=jsonc", function(json) {
$("#video").attr("src", json.data.items[0].content[5]);
});
// GITHUB
$.getJSON("http://github.com/api/v2/json/repos/show/" + user.github + "?callback=?", function(json) {
$('#projetos > .place').html("");
$.each(json.repositories, function(i, repository) {
$('#projetos > .place').append('<a class="repository" href="http://github.com/' + repository.owner + '/' + repository.name + '" target="_blank"><h3>' + repository.name + '</h3>' + repository.description.substring(0,40) + '</a>');
});
$('#projetos').append('<a class="more" href="http://github.com/' + user.github + '" target="_blank">+ projetos</a>');
});
// FLICKR
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=" + user.flickr.self + "&lang=pt-br&tags=" + user.flickr.tag + "&format=json&jsoncallback=?", function(json) {
$('#portifolio > .place').html("");
$.each(json.items, function(i, item) {
var imgPequena = (item.media.m).replace("_m.jpg", "_s.jpg");
var imgGrande = (item.media.m).replace("_m.jpg", ".jpg");
var titulo = item.title;
$('#portifolio > .place').append('<a href="' + imgGrande + '" target="_blank"><img src="' + imgPequena + '" alt="' + titulo + '" title="' + titulo + '" /></a>');
});
$('#portifolio').append('<a class="more" href="' + json.link + '" target="_blank">+ imagens</a>');
});
// DELICIOUS
$.getJSON("http://feeds.delicious.com/v2/json/" + user.delicious.self + "/" + user.delicious.tag + "?callback=?", function(json) {
$('#sites > .place').html("");
$.each(json, function(i, site) {
$('#sites > .place').append('<a class="site" href="' + site.u + '" target="_blank">' + site.d.substring(0,40) + '</a>');
});
$('#sites').append('<a class="more" href="http://www.delicious.com/' + user.delicious.self + '/byme" target="_blank">+ sites</a>');
});
// GISTS
$.getJSON("http://gist.github.com/api/v1/json/gists/" + user.gist + "?callback=?", function(json) {
$('#scripts > .place').html("");
$.each(json.gists, function(i, script) {
$('#scripts > .place').append('<a href="https://gist.github.com/' + script.repo + '" target="_blank">' + script.description + '</a>');
});
$('#scripts').append('<a class="more" href="https://gist.github.com/' + json.gists[0].owner + '" target="_blank">+ scripts</a>');
});
// TWITPIC
$('#fotos > .place').html("");
$.getJSON("http://api.twitpic.com/2/users/show.jsonp?username=" + user.twitpic + "&callback=?", function(json) {
$.each(json.images, function(i, image) {
if (i <= 7) {
$('#fotos > .place').append('<a href="http://twitpic.com/' + image.short_id + '" target="_blank"><img src="http://twitpic.com/show/mini/' + image.short_id + '"></a>');
}
});
$('#fotos').append('<a class="more" href="http://twitpic.com/photos/' + json.username + '" target="_blank">+ imagens</a>');
});
// FEEDS
function feeds() {
// ARTIGOS
var artigos = new google.feeds.Feed(user.feed);
artigos.load(function(result) {
$('#artigos > .place').html("");
$("#artigos h2").html(result.feed.title);
$.each(result.feed.entries, function(i, post) {
$('#artigos > .place').append('<a href="' + post.link + '" target="_blank">' + post.title + '</a>');
});
$('#artigos').append('<a class="more" href="' + user.feed + '" target="_blank">+ artigos</a>');
});
// APRESENTACOES
var apresentacoes = new google.feeds.Feed("http://www.slideshare.net/rss/user/" + user.slideshare);
apresentacoes.load(function(result) {
$('#apresentacoes > .place').html("");
$.each(result.feed.entries, function(i, slide) {
$('#apresentacoes > .place').append('<a href="' + slide.link + '" target="_blank">' + slide.title + '</a>');
});
$('#apresentacoes').append('<a class="more" href="http://www.slideshare.net/' + user.slideshare + '" target="_blank">+ apresentações</a>');
});
// LASTFM
var musicas = new google.feeds.Feed("http://ws.audioscrobbler.com/1.0/user/" + user.lastfm + "/recenttracks.rss");
musicas.load(function(result) {
$('#musicas > .place').html("");
$.each(result.feed.entries, function(i, musica) {
$('#musicas > .place').append('<a href="' + musica.link + '" target="_blank">' + musica.title + '</a>');
});
$('#musicas').append('<a class="more" href="http://www.lastfm.com.br/user/' + user.lastfm + '" target="_blank">+ músicas</a>');
});
}
google.setOnLoadCallback(feeds);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment