Skip to content

Instantly share code, notes, and snippets.

@ww24
Created August 22, 2011 07:40
Show Gist options
  • Save ww24/1161867 to your computer and use it in GitHub Desktop.
Save ww24/1161867 to your computer and use it in GitHub Desktop.
新Twitter用一斉返信ブックマークレット
javascript:(function(){var g=$("a.js-action-reply"),a="textarea.twitter-anywhere-tweet-box-editor",$t,n;for(var i=0,l=g.size();i<l;i++){t=g.eq(i);if(t.parent().find("a.js-action-replyAll").size()<1){n=t.data("screenName")||t.attr("data-screen-name");t.after('<a class="reply-action js-action-replyAll" href="#" title="一斉返信" data-screen-name="'+n+'" onclick="(function(){var t=$(\''+a+'\');t.val(\'@'+n+' \'+t.val())})();return false"><span><i></i><b>一斉返信</b></span></a>').data("screenName",n)}}})();
// setIntervalして新しく取得したツイートにも自動で適用させることもできるけど、重いので非推奨
// setInterval(function() {
(function() {
var $target = $("a.js-action-reply"),
tweetArea = "textarea.twitter-anywhere-tweet-box-editor",
$t,
screenName = "";
for (var i=0,l=$target.size(); i<l; i++) {
$t = $target.eq(i);
if ($t.parent().find("a.js-action-replyAll").size() < 1) {
screenName = $t.data("screenName") || $t.attr("data-screen-name");
$t.after('<a class="reply-action js-action-replyAll" href="#" title="一斉返信" data-screen-name="'+screenName+'" onclick="(function(){var t=$(\''+tweetArea+'\');t.val(\'@'+screenName+' \'+t.val())})();return false"><span><i></i><b>一斉返信</b></span></a>')
.data("screenName", screenName);
}
}
})();
//}, 500);
@ww24
Copy link
Author

ww24 commented Mar 24, 2012

更に新しいTwitterのUIが採用されたことで、使えなくなりました。
多分、少し変更すれば簡単に対応させることは可能。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment