Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

曲名から id を検索する機構 / ブックマークレットの出力から自動登録 #25

Open
kumamotone opened this issue Apr 24, 2016 · 2 comments

Comments

@kumamotone
Copy link
Owner

id と 曲名の組は簡単に取得できるはず
曲名からidが引ければ 曲名/難易度/達成率 だけ書いてある csv(tsv) から自動登録できる
tsv は現存する偉大なブックマークレット(http://www.nicovideo.jp/watch/sm27220060) がそのまま使える
クライアントサイドで 25回 × 1000曲の比較ぐらいならシュっとできるのでは

@kumamotone
Copy link
Owner Author

曲名/kind/rate を吐くブックマークレット

javascript:(function(){var res="<table><tr><td align=center>曲名</td><td align=center>kind</td><td align=center>rate</td></tr>";var classArray=document.getElementsByTagName("tr");for(var i=0;i<classArray.length;i++){if(i>0){var title=classArray[i].getElementsByClassName("text_link")[0].innerHTML;var percent=classArray[i].getElementsByClassName("achive_cell")[0].innerHTML.match(/(\d*\.*\d*)\%/)[1];var type=classArray[i].getElementsByClassName("music_seq_box")[0].innerHTML;var d=type.match(/part\_(\S{1})/)[1]+type.match(/diff\_(\S{1})/)[1];var k=0;if(d=="DB"){k=0;}else if(d=="DA"){k=1;}else if(d=="DE"){k=2;}else if(d=="DM"){k=3;}else if(d=="GB"){k=4;}else if(d=="GA"){k=5;}else if(d=="GE"){k=6;}else if(d=="GM"){k=7;}else if(d=="BB"){k=8;}else if(d=="BA"){k=9;}else if(d=="BE"){k=10;}else if(d=="BM"){k=11;}res=res+"<tr><td>"+title+"</td><td>"+k+"</td><td>"+percent+"</td></tr>";}}res=res+"</table>";document.write(res);})();

@kumamotone
Copy link
Owner Author

javascript:(function(){var res="name,kind,rate";res+='\n';var classArray=document.getElementsByTagName("tr");for(var i=0;i<classArray.length;i++){if(i>0){var title=classArray[i].getElementsByClassName("text_link")[0].innerHTML;var percent=classArray[i].getElementsByClassName("achive_cell")[0].innerHTML.match(/(\d*\.*\d*)\%/)[1];var type=classArray[i].getElementsByClassName("music_seq_box")[0].innerHTML;var d=type.match(/part\_(\S{1})/)[1]+type.match(/diff\_(\S{1})/)[1];var k=0;if(d=="DB"){k=0;}else if(d=="DA"){k=1;}else if(d=="DE"){k=2;}else if(d=="DM"){k=3;}else if(d=="GB"){k=4;}else if(d=="GA"){k=5;}else if(d=="GE"){k=6;}else if(d=="GM"){k=7;}else if(d=="BB"){k=8;}else if(d=="BA"){k=9;}else if(d=="BE"){k=10;}else if(d=="BM"){k=11;}res=res+""+title+","+k+","+percent+"\n";}}var filename='output.csv';var uri='data:text/csv,'+encodeURIComponent(res);var link=document.createElement('a');link.download=filename;link.href=uri;document.body.appendChild(link);link.click();document.body.removeChild(link);})();

csvで落とす

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant