Skip to content

Instantly share code, notes, and snippets.

@gerbz
Last active August 29, 2015 14:21
Show Gist options
  • Save gerbz/02f9cb6fb37def0e2212 to your computer and use it in GitHub Desktop.
Save gerbz/02f9cb6fb37def0e2212 to your computer and use it in GitHub Desktop.
Feedly Bookmarklet (ignores comment feeds)
javascript: void(el = document.getElementsByTagName('link'));
void(g = false);
for (i = 0; i < el.length; i++) {
if(r = el[i].getAttribute('rel')){
if (r.indexOf('alternate') != -1) {
if(t = el[i].getAttribute('type')){
if(t.indexOf('rss') != -1) {
if(h = el[i].getAttribute('href')){
if (h.indexOf('comment') == -1) {
if(t = el[i].getAttribute('title')){
t = t.toLowerCase();
if (t.indexOf('comment') == -1) {
g = true;
break;
}
}else{
g = true;
break;
}
}
}
}
}
}
}
};
if (!g) {
window.alert('Could not find the RSS Feed');
}else{
void(window.location.href = 'http://www.feedly.com/home#subscription/feed/' + h);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment