Created
December 2, 2015 16:07
-
-
Save nextrevision/0fd69069f1510cee2400 to your computer and use it in GitHub Desktop.
Script to convert Safari's reading list to JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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