Skip to content

Instantly share code, notes, and snippets.

@drart
Last active November 22, 2017 18:41
Show Gist options
  • Save drart/60b22ac81a97b999a4077c57bffb11ed to your computer and use it in GitHub Desktop.
Save drart/60b22ac81a97b999a4077c57bffb11ed to your computer and use it in GitHub Desktop.
Simple script that exports a users "Saved For Later" list out of Feedly as a JSON string without JQuery or SSL
// Simple script that exports a users "Saved For Later" list out of Feedly
// as a JSON string.
//
// Inpired by :
// https://gist.github.com/bradcrawford/7288411
// https://gist.github.com/ShockwaveNN/a0baf2ca26d1711f10e2
// https://github.com/dotEsuS/Feedly-Export-Save4Later/blob/master/script
//
// This was intended for use in the Google Chrome's "Inspector" tool so your
// mileage may vary if used in other contexts.
//
// Format of JSON is as follows:
// [
// {
// title: "Title",
// url: "www.example.com/title",
// description: "A descriptoin of an item",
// published: "Sunday "
// }
// ]
//
// How to use:
// 1) Open up Google Chrome
// 2) Login to Feedly and go to the "Saved For Later" list.
// 3) Keep scrolling down the page until all saved documents have been loaded
// 4) Right click on the page and select "Inspect Element"
// 5) Inside the "Inspector" tool, click the "Console" tab.
// 6) Paste the script below into the console and a JSON file should automatically download
//
var starreditems = []
var regex = /published:(.*)\ --/i;
var mylist = document.getElementsByClassName("list-entries");
for (var i = 0; i < mylist[0].childNodes.length;i++){
if (mylist[0].childNodes[i].getAttribute("data-title")){
var item = {};
item.title = mylist[0].childNodes[i].getAttribute("data-title");
item.url = mylist[0].childNodes[i].getAttribute("data-alternate-link");
item.description = mylist[0].childNodes[i].childNodes[4].childNodes[1].innerText;
item.published = regex.exec(mylist[0].childNodes[i].childNodes[5].getAttribute("title"))[1];
starreditems[i] = item;
}
}
json = JSON.stringify(starreditems, undefined, 2);
var blob = new Blob([json], {type: "text/plain;charset=utf-8"});
var blobUrl = URL.createObjectURL(blob);
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
a.download = "feedlystarred.json"
a.href = blobUrl;
a.click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment