Skip to content

Instantly share code, notes, and snippets.

@ide-an
Created January 28, 2013 05:18
Show Gist options
  • Save ide-an/4653258 to your computer and use it in GitHub Desktop.
Save ide-an/4653258 to your computer and use it in GitHub Desktop.
YouTubeの再生画面からBGMShareHouseにキューを投げるブックマークレット(非同期版)
// YouTubeの再生画面からBGMShareHouseにキューを投げるブックマークレット(非同期版)
// javascript:(function(h,d,e){e=d.createElement("script");e.src=h+"code.jquery.com/jquery-1.9.0.min.js";e.onload=function(){setTimeout(function(){jQuery.post(h+"bgm.tokor.org/query.php",{qmode:"new",qvalue:/v=(.{11})/.exec(location.href)[1]})},500);};d.body.appendChild(e)})("http://",document)
// コード削る前
(function(){
var url="http://code.jquery.com/jquery-latest.min.js";
var el=document.createElement("script");
el.src=url;
el.onload = function(){
setTimeout(function(){
console.log($,jQuery);
jQuery.post("http://bgm.tokor.org/query.php",{qmode:"new",qvalue:/v=(.{11})/.exec(location.href)[1]});
},500);
}
document.body.appendChild(el);
})()
// 削った後
(function(h,d,e){
e=d.createElement("script");
e.src=h+"code.jquery.com/jquery-1.9.0.min.js";
e.onload = function(){
setTimeout(function(){
jQuery.post(h+"bgm.tokor.org/query.php",{qmode:"new",qvalue:/v=(.{11})/.exec(location.href)[1]})
},500);
};
d.body.appendChild(e)
})("http://",document)
@tokoro10g
Copy link

Thank you ide_an!!

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