Skip to content

Instantly share code, notes, and snippets.

@nextrevision
Created December 2, 2015 16:07
Show Gist options
  • Save nextrevision/0fd69069f1510cee2400 to your computer and use it in GitHub Desktop.
Save nextrevision/0fd69069f1510cee2400 to your computer and use it in GitHub Desktop.
Script to convert Safari's reading list to JSON
# Usage: npm install plist-json && node readinglist2json.js
var plist = require('plist-json');
plist.parse(process.env.HOME + '/Library/Safari/Bookmarks.plist', function(err, json) {
if (err) {
console.log(err);
return;
}
for (i=0; i<json.Children.length; i++) {
if (json.Children[i].Title === 'com.apple.ReadingList') {
console.log(JSON.stringify(json.Children[i]));
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment