Skip to content

Instantly share code, notes, and snippets.

@awn-git
Created November 23, 2016 14:38
Show Gist options
  • Save awn-git/202b7342924e6c86b4094a95194f1e1b to your computer and use it in GitHub Desktop.
Save awn-git/202b7342924e6c86b4094a95194f1e1b to your computer and use it in GitHub Desktop.
bbsname
// 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