うたまっぷ歌詞無料検索の歌詞抽出
by
furyu-tei
2015-07-08 [2015/07/08 11:32:02]
うたまっぷ歌詞無料検索で表示される歌詞をテキストで抽出(元の歌詞(Canvas/Flash)直前にPREで追加)→集約(http://let.hatelabo.jp/furyu-tei/let/hLHXzbfzoZkS)
@@ -6,23 +6,40 @@
* @javascript_url
*/
-$.get(
- 'js_smt.php',
- {
- unum: location.href.match(/[?&]surl=([^&#]*)/)[1]
- },
- function(script){
- var chunks = [], elm;
- script.replace(
- /\.fillText\([\s\S]*?'((?:\\'|[^'])*)'[\s\S]*?\)/g,
- function(m, chunk){
- chunks.push(chunk.replace(/\\'/g, "'"));
- return m;
- }
- );
- elm = $('<pre/>');
- elm.text(chunks.join('\n')).css({border:'double 3px orange', padding:'4px'});
- $('#canvas2').before(elm);
- },
- 'html'
-);
+(function(w, d){
+var check = function(){
+ var $ = w.$, url = w.location.href;
+ if (!$) {
+ if (!d.getElementById('_jq')) {
+ var script = d.createElement('script');
+ script.id = '_jq';
+ script.src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js';
+ d.documentElement.appendChild(script);
+ }
+ setTimeout(check, 100);
+ return;
+ }
+ $.get(
+ url.match(/^https?:\/\/kids\./) ? 'js_smt_pc.php' : 'js_smt.php',
+ {
+ unum: url.match(/[?&]surl=([^?&]+)/)[1]
+ },
+ function(script){
+ var chunks = [], elm = $('<pre/>');
+ script.replace(
+ /\.fillText\(.*?'((?:\\'|[^'])*)'.*?\)/g,
+ function(m, chunk){
+ chunks.push(chunk.replace(/\\'/g, "'"));
+ return m;
+ }
+ );
+ elm = $('<pre/>');
+ elm.text(chunks.join('\n')).css({border:'double 3px orange', padding:'4px'});
+ $('#canvas2').before(elm);
+ },
+ 'html'
+ );
+};
+
+check();
+})(window, document);
/*
* @title うたまっぷ歌詞無料検索の歌詞抽出
* @description うたまっぷ歌詞無料検索で表示される歌詞をテキストで抽出(元の歌詞(canvas)上部にPREで追加)
* @include http://www.utamap.com/showkasi.php?surl=*
* @license MIT License
* @javascript_url
*/
(function(w, d){
var check = function(){
var $ = w.$, url = w.location.href;
if (!$) {
if (!d.getElementById('_jq')) {
var script = d.createElement('script');
script.id = '_jq';
script.src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js';
d.documentElement.appendChild(script);
}
setTimeout(check, 100);
return;
}
$.get(
url.match(/^https?:\/\/kids\./) ? 'js_smt_pc.php' : 'js_smt.php',
{
unum: url.match(/[?&]surl=([^?&]+)/)[1]
},
function(script){
var chunks = [], elm = $('<pre/>');
script.replace(
/\.fillText\(.*?'((?:\\'|[^'])*)'.*?\)/g,
function(m, chunk){
chunks.push(chunk.replace(/\\'/g, "'"));
return m;
}
);
elm = $('<pre/>');
elm.text(chunks.join('\n')).css({border:'double 3px orange', padding:'4px'});
$('#canvas2').before(elm);
},
'html'
);
};
check();
})(window, document);
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。