Skip to content

Instantly share code, notes, and snippets.

@yukihr
Created September 12, 2013 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yukihr/6544009 to your computer and use it in GitHub Desktop.
Save yukihr/6544009 to your computer and use it in GitHub Desktop.
SubscribeFeedly Bookmarklet Source
// 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