Twitter Unfollow Bookmarklet
by
laiso
2011-10-29 [2011/10/29 20:14:55]
twitter でfollowing を全員unfollow するブックマークレット http://d.hatena.ne.jp/laiso/20111029/p1
@@ -1,6 +1,6 @@
/*
* @title Twitter Unfollow Bookmarklet
- * @description twitter でfollowing を全員unfollow するブックマークレット
+ * @description twitter でfollowing を全員unfollow するブックマークレット http://d.hatena.ne.jp/laiso/20111029/p1
* @include https://mobile.twitter.com/*
* @license New BSD License
* @require jQuery
/*
* @title Twitter Unfollow Bookmarklet
* @description twitter でfollowing を全員unfollow するブックマークレット http://d.hatena.ne.jp/laiso/20111029/p1
* @include https://mobile.twitter.com/*
* @license New BSD License
* @require jQuery
*/
/*
* https://mobile.twitter.com/ のモバイルサイトへログインして https://mobile.twitter.com/following で実行
*/
(function(){
var LIMIT = 1000000000;
var screen_name = document.querySelector('.timeline-user b').innerText;
var authenticity_token = document.querySelector('input[name=authenticity_token]').value;
var ids = [];
$.getJSON('http://api.twitter.com/1/friends/ids.json?screen_name='+screen_name+'&callback=?',
null,
function(ids){
$(ids).each(function(i, id){
if(LIMIT < i) return;
endPoint = 'https://mobile.twitter.com/'+id+'/unfollow';
$.ajax({
type: 'POST',
url: endPoint,
data: 'authenticity_token='+authenticity_token+'&_method=delete&lasturl=%2Ffollowing',
success: function(){
console.log(i+' / '+LIMIT);
}
});
});
}
);
}())
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。