-
-
Save user19/5cfa535be47ea4e96d13 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 d=document; | |
var el=d.getElementsByTagName('link'); | |
var g=false; | |
var j=false; | |
for(i=0;i<el.length;i++){ | |
if(el[i].getAttribute('rel').indexOf('alternate')!=-1){ | |
ty=el[i].getAttribute('type'); | |
if(ty.indexOf('application/rss+xml')!=-1||ty.indexOf('text/xml')!=-1){ | |
g=true; | |
h=el[i].getAttribute('href'); | |
var k=h.substring(0,1); | |
if(k=='/'){ | |
h='http://'+location.host+h; | |
}break; | |
} | |
} | |
} | |
if(g){ | |
window.open('http://cloud.feedly.com/v3/feeds/feed'+encodeURIComponent('/' h)); | |
return; | |
} | |
if(!g){ | |
for(i=0;i<el.length;i++){ | |
if(el[i].getAttribute('rel').indexOf('alternate')!=-1){ | |
ty=el[i].getAttribute('type'); | |
if(ty.indexOf('application/atom+xml')!=-1){ | |
j=true; | |
h=el[i].getAttribute('href'); | |
var l=h.substring(0,1); | |
if(l=='/'){ | |
h='http://'+location.host+h; | |
} | |
break; | |
} | |
} | |
} | |
if(j){ | |
window.open('http://cloud.feedly.com/v3/feeds/feed'+encodeURIComponent('/' h)); | |
return; | |
} | |
if(!j){ | |
window.alert('Could not find the RSS/Atom Feed'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment