Created
October 27, 2009 09:22
-
-
Save mgng/219434 to your computer and use it in GitHub Desktop.
空耳すくレイピング
This file contains hidden or 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
(function(){ | |
function stripTags(str){return str.replace(/<[^>]+>/g, '');} | |
var buf = []; | |
var tables = document.getElementsByTagName('table'); | |
for(var i=0,l=tables.length; i<l; i++) { | |
var tr = tables[i].getElementsByTagName('tr'); | |
for(var j=0,ll=tr.length; j<ll; j++) { | |
var td = tr[j].getElementsByTagName('td'); | |
var tmp = []; | |
//if (td.length <= 2) { | |
if (td.length <= 2 || /アーティスト名/.test(td[0].innerHTML)) { | |
continue; | |
} | |
for(var k=0,lll=td.length; k<lll; k++) { | |
tmp.push(stripTags(td[k].innerHTML)); | |
} | |
buf.push(tmp); | |
} | |
} | |
// アーティスト名, 曲名, 空耳, 原詞, 評価 | |
var out = buf.join('<br>'); | |
document.body.innerHTML = out; | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment