Advertisement
pr4wn

screen scrape cpfc fa cup and pl fixtures into a ical file

Jul 25th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #!/bin/sh
  2. #screen scrape palace premier league and FA cup fixtures to a single ics file.
  3.  
  4. tdir=$TMP/footy
  5. cdir=$HOME/Documents/calendar
  6. calname=$cdir/cpfc.ics
  7.  
  8. mkdir -p $tdir
  9. cd $tdir
  10. rm *.ics
  11.  
  12. lynx -dump "http://www.premierleague.com/en-gb/matchday/matches.html?paramClubId=31&paramComp_8=true&paramComp_1=true&view=.dateSeason" > z.z
  13. arr=(`grep -a "\.ics\b" z.z |awk '{print $2}'`)
  14. for item in ${arr[*]}
  15. do
  16.     wget $item
  17.     rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
  18. done
  19.  
  20. cat *.ics > cpfc.ics
  21.  
  22. cp cpfc.ics $calname
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement