Skip to content

Instantly share code, notes, and snippets.

@user19
Created May 5, 2015 11:23
Show Gist options
  • Save user19/5ee3368b371e31b2bbdb to your computer and use it in GitHub Desktop.
Save user19/5ee3368b371e31b2bbdb to your computer and use it in GitHub Desktop.
var url='https://query.yahooapis.com/v1/public/yql?q=select * from html where url=\''+document.getElementsByClassName('commu_name')[0].href+'\' and xpath=\'//a[@class=\"community\"][starts-with(@href,\"http://live.nicovideo.jp/watch/\")]\'&format=json&env=store://datatables.org/alltableswithkeys';
var x=new XMLHttpRequest();
x.onload=function(){
var r=JSON.parse(x.responseText).query.results;
if(r!==null)
location.href=r.a.href;
};
setInterval(function(){
x.open('GET',url);
x.send();
},3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment