Created
May 5, 2015 11:23
-
-
Save user19/5ee3368b371e31b2bbdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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