Skip to content

Instantly share code, notes, and snippets.

@davidreuss
Created April 14, 2009 18:36
Show Gist options
  • Save davidreuss/95336 to your computer and use it in GitHub Desktop.
Save davidreuss/95336 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ $# -eq 2 ]; then
email="$1"
password="$2"
curl -L -d "email=$email&password=$password" -c ontv.cookie 'http://ontv.dk/scripts/users.php?action=login'
xmltvurl=$(curl -b ontv.cookie 'http://ontv.dk/xmltv' | perl -ne '/(http:\/\/ontv.dk\/xmltv\/\w+)/ and print $1')
curl -o xmltv.xml "$xmltvurl"
rm ontv.cookie
exit 0
else
echo "Exactly 2 arguments expected - email, and password."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment