Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Safari Readling List to Instapaper CSV (a ruby script for macOS)
# 1. Open
# 2. Type "cd Desktop" and Enter.
# 3. Type "open ~/Library/Safari/ ." and Enter.
# 4. Copy `Bookmarks.plist` file to the Desktop.
# 5. Back to the Terminal, type "ruby safari-readling-list-to-instapaper-csv.rb" and Enter.
# 6. Open Instapaper Settings (, and select "Import from Instapaper CSV."
# 7. Upload `instapaper-import.csv` from the Desktop.
require "plist"
require 'csv'
csv = CSV.generate do |csv|
bookmarks_xml = `plutil -convert xml1 -o - Bookmarks.plist`
Plist.parse_xml(bookmarks_xml)["Children"].select{ |e|
e["Title"] == ""
}[0]["Children"].map{ |e|
csv << [ # URL,Title,Selection,Folder,Timestamp
end"instapaper-import.csv", "w") do |f|
f.puts "URL,Title,Selection,Folder,Timestamp"
f.puts csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment