Created
November 20, 2015 15:43
-
-
Save davidrothera/95e079089f4e3c5bb37d to your computer and use it in GitHub Desktop.
Send Safari bookmarks to Pocket
This file contains 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
#!/bin/bash | |
# Script to export Safari's reading list into a text file and email the individual links | |
# First take all of Safari's Reading List items and place them in a text file. | |
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' > readinglistlinksfromsafari.txt | |
# Now loop over each of those URls within that text file and add them to pocket. | |
while IFS= read -r line | |
do | |
/usr/sbin/sendmail -i -f david.rothera@gmail.com add@getpocket.com <<END | |
Subject: Links | |
From: david.rothera@gmail.com | |
To: add@getpocket.com | |
$line | |
END | |
done < readinglistlinksfromsafari.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment