Skip to content

Instantly share code, notes, and snippets.

@user19
Created November 13, 2014 08:51
Show Gist options
  • Save user19/36a9233f4b48d4a41927 to your computer and use it in GitHub Desktop.
Save user19/36a9233f4b48d4a41927 to your computer and use it in GitHub Desktop.
setInterval(function(){
var x = new XMLHttpRequest();
x.onload = function(){
var r = JSON.parse(x.responseText).query.results;
if(r !== null)
window.location.href = r.a.href;
};
x.open("GET","https://query.yahooapis.com/v1/public/yql?q=select * from html where url=\""+window.document.getElementsByClassName("commu_name")[0].href+"\" and xpath=\"//div[@id=\'now_live\']//h2//a\"&format=json&env=store://datatables.org/alltableswithkeys",true);
x.send();
},3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment