Skip to content

Instantly share code, notes, and snippets.

@tjluoma
Created July 19, 2012 22:13
Show Gist options
  • Select an option

  • Save tjluoma/3147238 to your computer and use it in GitHub Desktop.

Select an option

Save tjluoma/3147238 to your computer and use it in GitHub Desktop.
Shell script to send all evening-edition.com URLs to Instapaper
#!/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.
@tjluoma
Copy link
Author

tjluoma commented Jul 19, 2012

see https://gist.github.com/3147226 for send2instapaper.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment