Skip to content

Instantly share code, notes, and snippets.

@matthiaskern
Last active June 30, 2017 02:27
Show Gist options
  • Save matthiaskern/2b57de135bf11b62f67b to your computer and use it in GitHub Desktop.
Save matthiaskern/2b57de135bf11b62f67b to your computer and use it in GitHub Desktop.

Revisions

  1. matthiaskern revised this gist Mar 4, 2016. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions feedly_export_saved_for_later.js
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,7 @@ if(!(window.jQuery)) {
    logItems();
    }

    var json;
    function logItems(){
    var map = $("#timeline").children().map(function(){
    if($(this).hasClass("section")){
    @@ -25,6 +26,8 @@ function logItems(){
    return links;
    }
    }).get();

    console.log(JSON.stringify(map, undefined, 2));
    }

    json = JSON.stringify(map, undefined, 2);
    console.log(json);
    }
    // type copy(json)
  2. matthiaskern created this gist Mar 4, 2016.
    30 changes: 30 additions & 0 deletions feedly_export_saved_for_later.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    if(!(window.jQuery)) {
    var script = document.createElement("script");
    script.setAttribute("src", "https://code.jquery.com/jquery-2.2.1.min.js");
    script.setAttribute("type", "text/javascript");
    script.onload = logItems;
    document.getElementsByTagName("head")[0].appendChild(script);
    } else {
    logItems();
    }

    function logItems(){
    var map = $("#timeline").children().map(function(){
    if($(this).hasClass("section")){
    return;
    }
    else{
    var elements = $(this).children();
    var links = elements.map(function(){
    var el = $(this);
    return {
    title: el.data("title"),
    url: el.data("alternate-link")
    };
    }).get();
    return links;
    }
    }).get();

    console.log(JSON.stringify(map, undefined, 2));
    }