Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saitamanodoruji/6110814 to your computer and use it in GitHub Desktop.
Save saitamanodoruji/6110814 to your computer and use it in GitHub Desktop.
list-up tumblr followings *AutoPagerize で全部表示させてから使う.
// ==UserScript==
// @id list-up tumblr followings
// @name list-up tumblr followings
// @version 1.0
// @namespace http://www.tumblr.com/
// @author saitamanodoruji
// @description
// @include http://www.tumblr.com/following
// @run-at document-end
// @grant GM_registerMenuCommand
// @grant GM_log
// ==/UserScript==
(function() {
// This function removes duplicate from the array given as an argument
// and return an array which contains removed elements.
var removeDuplicate2 = function(a) {
var b = [], i = 1, j, k
while (i < a.length) {
k = a.length
for (j = 0; j < i; j++) {
if (a[i] === a[j]) {
b.push(a[j])
a.splice(i,1)
break
}
}
if (k == a.length) i++
}
return b
}
GM_registerMenuCommand('make the list of names', function() {
var followings = Array.prototype.slice.call(document.querySelectorAll('.name'))
var names = followings.map(function(n) { return n.textContent })
var dupNames = removeDuplicate2(names)
GM_log('\n' + document.location
+ '\n\n' + dupNames.length + ' followings are duplicated.\n' + dupNames.join('\n')
+ '\n\nfollowing ' + names.length + ' tumblelogs.\n' + names.join('\n'))
})
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment