Advertisement
Guest User

Untitled

a guest
Nov 11th, 2010
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.16 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # First, fix the ABN AMRO MSN bot in your msn. Try searching on "Saldo Messenger"
  4. # Then use bitlbee :) http://bitlbee.org
  5. #
  6. # - Get the cron.pl irssi script <http://scripts.irssi.org/scripts/cron.pl>
  7. # - /jobadd * */5 * * * /msg -bitlbee AbnAmro saldo 1234
  8. # - Get the nohilight.pl irrsi script <https://github.com/kfdm/irssi-nohilight/raw/master/nohilight.pl>
  9. # - /set nohilight_nicks AbnAmro
  10. # - Use irssi logging
  11.  
  12.  
  13. logfile="/home/decramy/irclogs/bitlbee/abnamro.log"
  14. accounts=( 3194 2335 )
  15.  
  16. if [ "$1" = "autoconf" ]; then
  17.   echo yes
  18.   exit 0
  19. fi
  20.  
  21. if [ "$1" = "config" ]; then
  22.   echo 'graph_title ABN AMRO Account Balance'
  23.   echo 'graph_vlabel EURO'
  24.   for account in ${accounts[@]}; do
  25.     echo $account'.label Balance '$account
  26.   done
  27.   exit 0
  28. fi
  29.  
  30.  
  31. for account in ${accounts[@]}; do
  32.   line=`grep "op $account" $logfile | tail -n 1`
  33.   #                           20:11 <AbnAmro> Het saldo op je rekening eindigend op 1234     is EUR xxxxxx,xxxxxx (20:11, 10-11-2010).
  34.   balance=`echo $line | sed -e "/AbnAmro/ s/.*Het saldo op je rekening eindigend op $account is EUR \(.*\),\(.*\) (.*)./\1.\2/"`
  35.   echo $account".value" $balance
  36. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement