Created
July 19, 2012 22:13
-
-
Save tjluoma/3147238 to your computer and use it in GitHub Desktop.
Shell script to send all evening-edition.com URLs to Instapaper
This file contains hidden or 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/zsh | |
| # | |
| # see https://gist.github.com/3147226 for send2instapaper.sh | |
| lynx -listonly -dump -width=1024 -nomargins -nonumbers 'http://evening-edition.com/' |\ | |
| egrep -vi 'http://evening-edition.com/|https://twitter.com/|http://twitter.com/|\.org\.uk/$|\.com/$' |\ | |
| egrep '^http' |\ | |
| while read line | |
| do | |
| send2instapaper.sh "$line" | |
| sleep 2 | |
| done | |
| # OK, the above gave us all of the articles linked from the Evening Edition, but not | |
| # the actual Evening Edition page itself. We get that URL by checking the RSS feed | |
| # for "the first link which is not a link to the main site" | |
| TODAY=$(curl -sL 'http://evening-edition.com/feed/' |\ | |
| fgrep -v '<link>http://evening-edition.com</link>' |\ | |
| fgrep '<link>' | head -1 | sed 's#</link>##g ; s#.*<link>##g') | |
| # and now we send THAT to Instapaper too | |
| send2instapaper.sh "$TODAY" | |
| # the other advantage here is that if you have "newest on top" in Instapaper, the summary will | |
| # come before all of the other articles. | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see https://gist.github.com/3147226 for send2instapaper.sh