Import Safari bookmarks into Instapaper
Import Safari bookmarks into Instapaper
I recently switched from Pocket to Instapaper and thought it would be nice to also have my Safari bookmarks in Instapaper. This is how I did it:
First convert the Safari bookmarks file 'Bookmarks.plist' to XML: /usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist > Bookmarks.xml
Then, using XPath, extract all the URLs and titles from the generate XML file: //key[.="URIDictionary"]/../dict/key[.="title"]/../string/text()|//key[.="URLString"]/../string[contains(text(),'http')]/text()
Save the result (you should have a list with the following repeating pattern: Title
URL ...) into a text file (e.g. url_titles.txt). Script to generate pocket export html from list of titles and urls: -- convert.sh -- while read f; do read s echo "
- "$f" " done
Generate Pocket-compatible export HTML file: convert.sh > exported.html
Finally, in Instapaper settings choose import from Pocket and select 'exported.html'