Created
May 20, 2010 13:02
-
-
Save youpy/407540 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 replace retweet link | |
// @namespace http://d.hatena.ne.jp/youpy/ | |
// @include http://twitter.com/* | |
// ==/UserScript== | |
var $ = unsafeWindow.$; | |
$('.retweet-link').live('click', function(e) { | |
var id = e.target.parentNode.parentNode.parentNode.parentNode.parentNode.id.match(/status_(.+)/)[1]; | |
var status = $('#status'); | |
var text = 'RT {"id":' + id +'}'; | |
if(status.length) { | |
status.val(status.val() + ' ' + text); | |
} else { | |
location.href = 'http://twitter.com/?status=' + encodeURIComponent(text); | |
} | |
e.stop(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment