Skip to content

Instantly share code, notes, and snippets.

@manufaktor
Created June 15, 2012 11:26
Show Gist options
  • Save manufaktor/2935965 to your computer and use it in GitHub Desktop.
Save manufaktor/2935965 to your computer and use it in GitHub Desktop.
Extracting links from your Safari Reading List
# Extracting links from your Safari Reading List
#
# Copy your Safari Bookmarks file first:
# cp ~/Library/Safari/Bookmarks.plist
#
# Convert the binary plist to xml
# plutil -convert xml1 Bookmarks.plist
#
# install the plist gem
# gem install plist
#
require 'plist'
content = Plist::parse_xml('Bookmarks.plist')
links = content['Children'][4]['Children'].map { |hash| hash['URLString'] }
puts links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment