Created
September 12, 2013 21:24
-
-
Save hara-y-u/6544009 to your computer and use it in GitHub Desktop.
SubscribeFeedly Bookmarklet Source
This file contains 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
// Compile with: | |
// http://subsimple.com/bookmarklets/jsbuilder.htm | |
(function(w) { | |
var r, i, u, t, | |
l = document.getElementsByTagName('link'), | |
ll = l.length; | |
for(i=0; i<ll; i++) { | |
if(l[i].getAttribute('rel') === 'alternate' | |
&& (t = l[i].getAttribute('type')) | |
&& ( t === 'text/xml' | |
|| t === 'application/xml' | |
|| t === 'text/atom+xml' | |
|| t === 'text/rss+xml' | |
|| t === 'application/atom+xml' | |
|| t === 'application/rdf+xml' | |
|| t === 'application/rss+xml')) { | |
r = l[i]; | |
break; | |
} | |
} | |
if(!r) { | |
w.alert('Feed Not Found.'); | |
} else { | |
u = r.getAttribute('href'); | |
if(/^\//.test(u)) { | |
u = w.location.protocol+'//'+w.location.host+u; | |
} | |
w.open('http://cloud.feedly.com/#subscription%2Ffeed%2F' | |
+encodeURIComponent(u)).focus(); | |
} | |
}(window)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment