Skip to content

Instantly share code, notes, and snippets.

@chuckwagoncomputing
Created September 7, 2013 02:58
Show Gist options
  • Save chuckwagoncomputing/6472441 to your computer and use it in GitHub Desktop.
Save chuckwagoncomputing/6472441 to your computer and use it in GitHub Desktop.
Schlock Mercenary Getter
#!/bin/bash
DATE=$(date -d "$1" +%Y-%m-%d)
URL="http://schlockmercenary.com/$DATE"
PICS=$(xidel $URL -e "//@src/resolve-uri(.)" 2> /dev/null | egrep '[0-9][a-z].(png|jpg)')
if [ -z "$PICS" ]; then
PICS=$(xidel $URL -e "//@src/resolve-uri(.)" 2> /dev/null | egrep '[0-9].[png|jpg]' | head -n 1)
fi
echo "$PICS"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment