Skip to content

Instantly share code, notes, and snippets.

@topherh
Created May 20, 2012 23:05
Show Gist options
  • Save topherh/2759864 to your computer and use it in GitHub Desktop.
Save topherh/2759864 to your computer and use it in GitHub Desktop.
Next XX Days for UW Events
#!/bin/bash
########################################################################
#### Script to smartly pull a range of events from the UW Calendar ####
#### ####
#### Usage: setup in crontab of user ####
#### ####
#### Author: Chris Heiland, cheiland@uw.edu 6/14/2010 ####
########################################################################
START=`date +"%Y%m%d"`
END=`date --date "$START 21 days" +"%Y%m%d"`
HOME='/home/dir'
EVENTS=$HOME'/public_html/events.xml'
URL1='http://myuw.washington.edu/cal/doExport.rdo?export.action=execute&'
URL2='export.format=rss&export.compress=false&export.name=All+Public+Events+'
URL3='(except+class+meetings)&export.start.date='$START'&export.end.date='$END
## Because it's way too long to have on one line
URL=$URL1$URL2$URL3
curl -s $URL -o $EVENTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment