Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
// ==UserScript==
// @name Togetter List Owner Post Counter
// @namespace http://d.hatena.ne.jp/Pasta-K
// @include http://togetter.com/li/*
// ==/UserScript==
var mastername = document.querySelector('.icon_author').innerHTML;
var list = document.querySelectorAll('.list_body');
var i,c,postuser;
var all = list.length;
c=0;
for(i=0; i<list.length; i++){
postuser=list[i].querySelector('div.status > a').innerHTML;
if(mastername==postuser){
c++;
}
}
var par=(c/all*100).toFixed(1);
var addElem=document.createElement('span');
addElem.innerHTML=("自id採用率<br>"+par+"%<br>("+c+""+all+"");
var infoElem=document.querySelector('div.info_box_left');
infoElem.insertBefore(addElem,infoElem.lastChild);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment