Skip to content

Instantly share code, notes, and snippets.

@drakmail
Created August 20, 2012 09:18
Show Gist options
  • Save drakmail/3402580 to your computer and use it in GitHub Desktop.
Save drakmail/3402580 to your computer and use it in GitHub Desktop.
#!/bin/sh
LOGIN=dfsaf
PASSWORD=fsdafdsf
# Save cookie
curl -d "login=$LOGIN&password=$PASSWORD" -c /tmp/rialcom.cookie http://stat.rialcom.ru/
# Load page
curl -s -b /tmp/rialcom.cookie http://stat.rialcom.ru/ > /tmp/rialcom.page
BALANCE=`cat /tmp/rialcom.page | grep -A 1 "Баланс" | sed -e :a -e 's/<[^<]*>/ /g;/</{N;s/\n/ /;ba;}' | tail -n 1 | tr -d ' '`
echo "$BALANCE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment