Skip to content

Instantly share code, notes, and snippets.

@seb3point0
Created October 2, 2013 12:30
Show Gist options
  • Select an option

  • Save seb3point0/6792955 to your computer and use it in GitHub Desktop.

Select an option

Save seb3point0/6792955 to your computer and use it in GitHub Desktop.

Revisions

  1. @scouture scouture created this gist Oct 2, 2013.
    23 changes: 23 additions & 0 deletions add-to-feedly-bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    (function() {
    void(d = document);
    void(el = d.getElementsByTagName('link'));
    void(g = false);
    void(count = 0);
    for (i = 0; i < el.length; i++) {
    if (el[i].getAttribute('rel').indexOf('alternate') != -1) {
    if(count == 0) {
    ty = el[i].getAttribute('type');
    if(ty.indexOf('application/rss+xml') != -1 || ty.indexOf('text/xml') != -1) {
    h = el[i].getAttribute('href');
    if(h.indexOf('comments') == -1) {
    g = true;
    window.open('http://www.feedly.com/home#subscription/feed/' + h, '_blank');
    }
    }
    }
    count++;
    }
    }
    if (!g) { window.alert('Could not find the RSS Feed') }
    void(0);
    })();