Created
May 22, 2010 01:19
-
-
Save arikui/409653 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name mobile to pc | |
// @namespace d.hatena.ne.jp/arikui | |
// @include http://twitter.com/* | |
// ==/UserScript== | |
for each(var a in document.querySelectorAll('.entry-content a')) (function(a){ | |
if(!a.href.match("http://mobile.twitter.com/statuses/")) return; | |
GM_xmlhttpRequest({ | |
method: "GET", | |
url: a.href, | |
onload: function(responseDetails){ | |
if(responseDetails.status == 404){ | |
a.parentNode.removeChild(a); | |
return; | |
} | |
var match = responseDetails.responseText.match(/href="([^"]+)"\sclass="status_link"/); | |
a.href = "http://twitter.com" + match[1]; | |
a.textContent = a.href; | |
} | |
}); | |
})(a); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment