Forked from erineland/exportsafarireadinglist.sh
Last active
December 15, 2015 10:03
-
-
Save johnybradshaw/8515f25e039cc03a4f0c to your computer and use it in GitHub Desktop.
Export Safari's Reading List to Pocket/Evernote (or any service with an "email content in" feature)
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
I had issues getting this to run on OSX, updated to add an additional line break after the email address. | |
Also changed the subject to a generic term as complex URLs was borking it. |
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 [email protected] [email protected] <<END | |
Subject: Link | |
From: [email protected] | |
To: [email protected] | |
$line | |
END | |
done < readinglistlinksfromsafari.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment