Add Syntax Highlighting (this will take a few seconds, probably freezing your browser while it works)
/*
IdentityBurro for GreaseMonkey
Version 0.3
(C) 2005 Paolo Massa under cc-by-sa
License: Creative Commons "Attribution-ShareAlike 2.5"
http://creativecommons.org/licenses/by-sa/2.5/
Parts of the code comes from the great BookBurro extension that is
(C) 2005 Jesse Andrews, Britt Selvitelle under cc-by-sa
Also the inspiration for this extension comes mainly from BookBurro
extension. Thanks for sharing under a CC licence!
Snipits used from RSS Reader for GreaseMonkey
http://www.xs4all.nl/~jlpoutre/BoT/Javascript/RSSpanel/
Version: 1.03 (C) 2005 Johannes la Poutre
THANKS!
Changelog:
0.1 - initial release (working on flickr, del.icio.us and technorati) - July 17, 2005
0.2 - tweaked to add: citeulike, last.fm (+audioscrobbler), 43things/places/ideas/allconsuming, rojo and lj
plus modified idburro() to create a collapse button/function 0.--- Daniel Dockery, peritus@gmail.com, Aug 15, 2005
0.3 - refactored the code a bit and cleaned it up (resetStyle, images are more separated from code).
added webjay.org and audioscrobbler.com (however audioscrobbler has been incorporated into last.fm so the code is commented but maybe in future it will be useful again.
added 2 todos. added some comments
in the code. --Paolo Massa, massa@itc.it, Aug 25, 2005
*/
// ==UserScript==
// @name Identity Burro - Remixing identities on social sites
// @namespace http://moloko.itc.it/paoloblog/
// @description When on userpage of an user on a social site (such as flickr, del.icio.us, etc), provide links to userpages of same username on other social sites.
// @include http://flickr.com*
// @include http://www.flickr.com*
// @include http://del.icio.us/*
// @include http://technorati.com/*
// @include http://www.technorati.com/*
// @include http://*.43things.com/person/*
// @include http://*.43places.com/person/*
// @include http://43.allconsuming.net/person/*
// @include http://*.livejournal.com*
// @include http://*rojo.com/people/profile/?handle=*
// @include http://*citeulike.org/user/*
// @include http://www.last.fm/user/*
// @include http://webjay.org/*
// @include http://www.webjay.org/*
// @exclude
// ==/UserScript==
(function() {
var resetStyle="text-decoration: none; font-weight:normal;background:none;border:0;padding:0;margin:0;text-align:left;";
//this function creates a link, i.e. an <A> element
function dom_createLink(url, txt, title) {
var a = document.createElement("a");
a.setAttribute("href", url);
a.setAttribute("style",resetStyle+"color:#00b;");
if (title) a.setAttribute("title", title);
a.appendChild(document.createTextNode(txt));
return a;
}
//this function create a new Table Row (<TR>) with 2 <TD>: first <TD> contains the icon of the target social site (as link to the user profile on that site), second <TD> contains a text link "<username> on <target site>"
function create_link_row(username,site,url,base64icon) {
var icon = document.createElement("a");
var icon_img = document.createElement("img");
icon_img.setAttribute("src","data:image/png;base64,"+base64icon);
icon_img.setAttribute("style",resetStyle);
// icon_img.setAttribute("border", "0");
icon.appendChild(icon_img);
icon.setAttribute("style",resetStyle);
icon.setAttribute("title",username+" on "+site);
icon.setAttribute("href",url);
var a = dom_createLink(url,username+' on '+site, 'Link to '+username+' on '+site);
var tr = document.createElement("tr");
tr.setAttribute("style",resetStyle);
var td_left = document.createElement("td");
var td_right = document.createElement("td");
td_left.setAttribute("style",resetStyle+"padding-left:6px;");
td_right.setAttribute("style",resetStyle+"padding-left:6px;");
td_left.appendChild(icon);
td_right.appendChild(a);
td_right.setAttribute("align", "left");
tr.appendChild(td_left);
tr.appendChild(td_right);
return tr;
}
//this function create the entire <DIV> element containing all the links and images for current user <username>
function idburro( username ) {
//base64 encoding of the site icons.
var technorati_icon_base64="iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QcRAh0YOybr8gAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAABrUlEQVQY042PP2gTcRTHP7/f3fWO1oQcSaNV0Epti4I2g6RgjAjqojgUB+1QHIQ6tIsoSLcuWigupZRQFAQFBwXxD7o4KYqjTkaLpITa0pScjc3Z5C53PQdp6D+Ln+29x+e97xOuXw0e50Z5khujPZzgdvIVmtQpVn/w6PsIHwsvsZx5Ig0xuuNn6T1wk92N7YjJLzeCB1N3UKVKJv2Wg5FjLFSmGfyQZu73LBuJGlEmjr9HvsjfBc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AAAAAElFTkSuQmCC"; //not used
//to create other base64icon, just save an image on your local disk
// (should be 14x12 pixels)
//then run something like
//> python /usr/lib/python2.3/base64.py your_image_icon_file.png
//base64 encodings of icons used in the interface
var expand_button_icon_base64 = "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAAAAABzHgM7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QcQDywr8s95YAAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAAAM0lEQVQI13WOMQ4AIAwCD+L/v1wHm4qDTAckBBVXDmYBIKC6acbBOPgd8Ek1zTgTTt8HG+RECReJSxyFAAAAAElFTkSuQmCC";
var collapse_button_icon_base64 = "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAALHRFWHRDcmVhdGlvbiBUaW1lAE1vbiAxNSBBdWcgMjAwNSAxOTowMzowNCAtMDYwMHCzYxkAAAAHdElNRQfVCBAAAxtPBqFNAAAACXBIWXMAAAsSAAALEgHS3X78AAAABGdBTUEAALGPC/xhBQAAAD9JREFUeNpj/P//PwMhwERQBRCwwFmMjIxwNprxTFglkDWgW4dLHbqbsKojyuHoirA6n4mgChRFeIKAkWohDgBfrBsTQ001dwAAAABJRU5ErkJggg==";
var close_button_icon_base64 = "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAAAAABzHgM7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QcQDx0R8p6nYAAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAAAN0lEQVQI122OQQ4AMAjCiv//MzvAsiybB4MKjTKnhnuQIH0ABFm4Aufi6gdQf2ngJKd+b9r/gwXGyQoXw2hMKQAAAABJRU5ErkJggg==";
var logo_button_icon_base64 =
"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAAAAABzHgM7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QcQDywr8s95YAAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAAAM0lEQVQI13WOMQ4AIAwCD+L/v1wHm4qDTAckBBVXDmYBIKC6acbBOPgd8Ek1zTgTTt8HG+RECReJSxyFAAAAAElFTkSuQmCC";
var about_button_icon_base64 = "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAAAAABzHgM7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QcRATMLttkdWQAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAAANklEQVQI11WNQQ4AMAjCqvH/X2YHdHOcIG1CiJcCAgBBTidMUONyNc7raIb7kHb3T2uxRufTDg3YCRz3chRaAAAAAElFTkSuQmCC";
var box = document.createElement("div");
box.setAttribute("id","idBdiv");
box.setAttribute("title","Click box to expand/collapse");
box.setAttribute("style",resetStyle+"position:fixed;z-index:99;top:40px;right:-140px;background-color:#eef;border:1px dotted #111;padding:2px;text-align:left;opacity:.85;font:8pt sans-serif;overflow:hidden;width:174px;margin-bottom:15px;padding:0;margin:0;");
var expand = document.createElement("img");
expand.setAttribute("src","data:image/png;base64,"+expand_button_icon_base64);
expand.setAttribute("style",resetStyle+"position:absolute;left:1px;top:1px;margin:1px;width:12px;height:12px;background-color:#ffb;border:1px solid black;line-height:8px;text-align:center;");
expand.setAttribute("title","Click To Expand");
expand.onclick = function() {
this.parentNode.style.display = "block";
this.parentNode.style.right = "0px";
this.setAttribute("src","data:image/png;base64,"+collapse_button_icon_base64);
this.setAttribute("title","Click to Collapse");
this.onclick = function() {
var n = document.getElementById("idBdiv"); n.style.display = 'none';
n.parentNode.removeChild(n); idburro(username);
}
};
box.appendChild(expand);
var close = document.createElement("img");
close.setAttribute("src","data:image/png;base64,"+close_button_icon_base64);
close.setAttribute("style",resetStyle+"position:absolute;left:18px;top:1px;margin:1px;width:12px;height:12px;background-color:#ffb;border:1px solid black;line-height:8px;text-align:center;");
close.setAttribute("title","Click To Remove");
close.onclick = function() {
var n = document.getElementById("idBdiv"); n.style.display = 'none';
n.parentNode.removeChild(n);
};
box.appendChild(close);
var logo = document.createElement("div");
logo.setAttribute("src","data:image/png;base64,"+logo_button_icon_base64);
logo.setAttribute("style",resetStyle+"position:absolute;left:51px;top:3px;margin:2px;height:12px;border:0;line-height:8px;text-align:center;font-weight:bold;");//font:10pt sans-serif;");
logo.setAttribute("title","Identity Burro");
logo.innerHTML="Identity Burro";
box.appendChild(logo);
var about = document.createElement("a");
var about_img = document.createElement("img");
about_img.setAttribute("style",resetStyle);
about_img.setAttribute("src","data:image/png;base64,"+about_button_icon_base64);
about.appendChild(about_img);
about.setAttribute("style",resetStyle+"position:absolute;left:151px;top:1px;margin:2px;width:12px;height:12px;background-color:#ffb;border:1px solid black;line-height:8px;text-align:center;");
about.setAttribute("title","Paolo Blog");
about.setAttribute("href","http://moloko.itc.it/paoloblog/archives/2005/07/17/identity_burro_greasemonkey_extension_for_social_sites.html" );
box.appendChild(about);
var table = document.createElement("table");
table.setAttribute("style", resetStyle+"padding-top:20px;width:100%;font:8pt sans-serif;margin:3px;");
table.appendChild(create_link_row(username,"del.icio.us",'http://del.icio.us/'+username,delicious_icon_base64));
table.appendChild(create_link_row(username,"Flickr",'http://flickr.com/photos/'+username,flickr_icon_base64));
table.appendChild(create_link_row(username,"Technorati",'http://technorati.com/profile/'+username,technorati_icon_base64));
table.appendChild(create_link_row(username,"Cite-u-Like",'http://www.citeulike.org/user/'+username,citeulike_icon_base64));
table.appendChild(create_link_row(username,"WebJay",'http://webjay.org/by/'+username,webjay_icon_base64));
table.appendChild(create_link_row(username,"Last.FM",'http://last.fm/user/'+username,last_fm_icon_base64));
// table.appendChild(create_link_row(username,"Audioscrobbler",'http://audioscrobbler.com/user/'+username,audioscrobbler_icon_base64)); //audioscrobbler has been incorporated into last.fm
table.appendChild(create_link_row(username,"Rojo",'http://www.rojo.com/people/profile/?handle='+username,rojo_icon_base64));
table.appendChild(create_link_row(username,"43Things",'http://www.43things.com/person/'+username,ft_icon_base64));
// table.appendChild(create_link_row(username,"43ThingsIdeas",'http://ideas.43things.com/person/'+username,ft_icon_base64));
table.appendChild(create_link_row(username,"43Places",'http://www.43places.com/person/'+username,ft_icon_base64));
// table.appendChild(create_link_row(username,"43PlacesIdeas",'http://ideas.43places.com/person/'+username,ft_icon_base64));
table.appendChild(create_link_row(username,"AllConsuming",'http://43.allconsuming.net/person/'+username,ft_icon_base64));
table.appendChild(create_link_row(username,"Livejournal",'http://www.livejournal.com/users/'+username,livejournal_icon_base64));
box.appendChild(table);
document.getElementsByTagName("body")[0].appendChild(box);
}
function extractUsername (url) {
var username;
if (document.location.href.match(/^http:\/\/(www\.)?flickr\.com\/photos\//) ) {
var parsedUrl = document.location.href.match(/^(http:\/\/(www\.)?flickr.com\/(photos|people)\/)([^\/]*)([^\/]*)([^\/]*)/ );
username=parsedUrl[4];
}
if ((!(document.location.href.match(/^http:\/\/del.icio.us\/(login|register|popular|doc|about|tag|tags|rss|all|inbox|logout|settings|post|url|search)/)))&&(document.location.href.match(/^http:\/\/del.icio.us\//))) {
var parsedUrl = document.location.href.match(/^(http:\/\/del.icio.us\/([^\/]*)([^\/]*))/);
username=parsedUrl[2];
}
if (document.location.href.match(/^http:\/\/(www\.)?technorati.com\/profile\//)) {
var parsedUrl = document.location.href.match(/^http:\/\/(www\.)?technorati.com\/profile\/([^\/]*)/);
username=parsedUrl[2];
}
if (document.location.href.match(/^http:\/\/(www\.)?livejournal.com\/userinfo\.bml\?*user=([^&]*)/)) {
var parsedUrl = document.location.href.match(/^http:\/\/(www\.)?livejournal.com\/userinfo\.bml\?*user=([^&]*)/);
username=parsedUrl[2];
}
if (document.location.href.match(/^http:\/\/(www\.)?last.fm\/user\/([^\/]*)/)) {
var parsedUrl = document.location.href.match(/^http:\/\/(www\.)?last.fm\/user\/([^\/]*)/);
username=parsedUrl[2];
}
if (document.location.href.match(/^http:\/\/([^\.]*)\.livejournal.com\/?$/)) {
var parsedUrl = document.location.href.match(/^http:\/\/([^\.]*)\.livejournal.com\/?$/);
if (parsedUrl[1] != 'www') {
username=parsedUrl[1];
}
}
if (document.location.href.match(/^http:\/\/(www\.)?livejournal.com\/users\/([^\/]*)\/?/)) {
var parsedUrl = document.location.href.match(/^http:\/\/(www\.)?livejournal.com\/users\/([^\/]*)\/?/);
username=parsedUrl[2];
}
if (document.location.href.match(/^http:\/\/.*\.43(things|places)\.com\/person\/([^\/]*)/)) {
var parsedUrl = document.location.href.match(/^http:\/\/.*\.43(things|places)\.com\/person\/([^\/]*)/);
username=parsedUrl[2];
}
if (document.location.href.match(/^http:\/\/43\.allconsuming\.net\/person\/([^\/]*)/)) {
var parsedUrl = document.location.href.match(/^http:\/\/43\.allconsuming\.net\/person\/([^\/]*)/);
username=parsedUrl[1];
}
if (document.location.href.match(/^http:\/\/(www\.)?rojo.com\/people\/profile\/\?handle=([^\/]*)/)) {
var parsedUrl = document.location.href.match(/^http:\/\/(www\.)?rojo.com\/people\/profile\/\?handle=([^\/]*)/);
username=parsedUrl[2];
}
if (document.location.href.match(/http:\/\/(www\.)?citeulike.org\/user\/([^\/]*)/)) {
var parsedUrl = document.location.href.match(/http:\/\/(www\.)?citeulike.org\/user\/([^\/]*)/);
username=parsedUrl[2];
}
if (document.location.href.match(/^http:\/\/(www\.)?webjay.org\/by\//)) {
var parsedUrl = document.location.href.match(/^http:\/\/(www\.)?webjay.org\/by\/([^\/]*)/);
username=parsedUrl[2];
}
/*
//audioscrobbler has been incorporated into last.fm
if (document.location.href.match(/^http:\/\/(www\.)?audioscrobbler.com\/user\//)) {
var parsedUrl = document.location.href.match(/^http:\/\/(www\.)?audioscrobbler.com\/user\/([^\/]*)/);
username=parsedUrl[2];
}
*/
return username;
}
var username = extractUsername(document.location.href);
if(username) {
idburro(username);
}
})();
/*
TODO July 17, 2005
# when expanded, part of the unexpanded interface (buttons and icons)
remains in background, more transparent. understand why and fix it
# when expanded the "expand" icon should become a "collapse" icon (the
arrow in the other direction). --- Peritus: Aug 15, done
# some CSS properties are inherited from the current site, so that for
example, the extension looks a bit different in flickr and in
del.icio.us. Understand which are the properties of which elements
and overwrite them (surely the background of some elements is
inherited).
I created the variable resetStyle that tries to reset all the styles
and it is prepended in every your_element.setAttribute("style",resetStyle+ "your specific inline css here")
# adding some of these sites
//webjay
//citeulike --- Peritus: Aug 15, added
//last.fm --- Peritus: Aug 15, added
//audioscrobbler --- Peritus: this has been incorporated into last.fm
//furl
//wist
//blogmarks
//43things --- Peritus: Aug 15, added; also 43places, and the 43Ideas of both sites, as well as AllConsuming
//tagsurf
//upcoming
//jots
//podcast
//consumating
//rojo --- Peritus: Aug 15, added
//bloglines
//smugsmug
//bookswelike
//kinja.com
//Actually I hope that flickr or del.icio.us (or another social site)
//will soon allow its users to set (in the profile) what are her
//usernames on other sites.
//In this way this extension will not have to assume that xxx@flickr
//is also xxx@del.icio.us but can be yyy@del.icio.us
# creating an ajax method that query google or yahoo! for "<username>
blog" and creates a link with the first returned result (possibly the
highest in the two queries?) with anchor text such as "guessed blog of
<username>". For the ajax-power, I guess I need to steal, ... ehm,
take inspiration again from the fantastic bookburro code! ;-)
# on a link such as http://del.icio.us/phauly?setbundleview=hide, the
extractUsername function extracts as username
"phauly?setbundleview=hide" so the links will be such as
http://flickr.com/phauly?setbundleview=hide and this is not
correct. We want to change the regexps to stop at the first "?"
symbol.
*/