Created
November 23, 2016 14:38
-
-
Save awn-git/202b7342924e6c86b4094a95194f1e1b to your computer and use it in GitHub Desktop.
bbsname
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
// note: bbsmenuから bbsname -> bbsnameJ なJSONを作る | |
// ref: http://menu.open2ch.net/bbsmenu.html | |
var bbs = document.querySelectorAll("a"); | |
var outobj = {}; | |
for(var ix = 0, len = bbs.length; ix < len; ix++){ | |
if( (bbs[ix].href).indexOf("http://") > -1 ){ | |
outobj[ (bbs[ix].pathname).replace(/\//g,"") ] = bbs[ix].innerText; | |
} | |
} | |
JSON.stringify( outobj ); | |
// note: bbsmenuから bbsname -> {bbsnameJ,url} なJSONを作る | |
// ref: http://menu.open2ch.net/bbsmenu.html | |
var bbs = document.querySelectorAll("a"); | |
var outobj = {}; | |
for(var ix = 0, len = bbs.length; ix < len; ix++){ | |
if( (bbs[ix].href).indexOf("http://") > -1 ){ | |
outobj[ (bbs[ix].pathname).replace(/\//g,"") ] = { | |
bbsnameJ : bbs[ix].innerText, | |
url : bbs[ix].href | |
}; | |
} | |
} | |
JSON.stringify( outobj ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment