Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save youpy/88102 to your computer and use it in GitHub Desktop.
Save youpy/88102 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name wescript show twitter icon
// @namespace http://taizooo.tumblr.com/
// @description show twitter icon on wescript
// @include http://wescript.net/*
// @require http://gist.github.com/raw/3242/9dc0cdee5e975d275c7ab71f581d272eb316674f/dollarX.js
// ==/UserScript==
// respect http://beta.wescript.net/scripts/3124
// thx!!! mattn (http://mattn.kaoriya.net/)
// icon from http://usericons.relucks.org/
//
(function() {
var usericons = 'http://usericons.relucks.org';
var service = 8; //twitter
var services = [
'flickr', //0
'github', //1
'hatena', //2
'lastfm', //3
'logpi', //4
'najimi', //5
'nowa', //6
'turnyournameintoaface', //7
'twitter', //8
'wassr', //9
];
function geticon(n) {
var url = usericons + '/' + services[service] + '/' + n.alt;
GM_xmlhttpRequest({
method: 'HEAD',
url: url,
onload: function(res){
if (res.status == 200) {
n.src = url;
}
}
});
}
$X('//h2/img').forEach(geticon);
$X('//a[contains(@href,"/users/") and not(contains(@href,".atom"))]/img').forEach(geticon);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment