3 # Odd. Seems the following causes wget to use IPv6 instead of IPv4. Well
4 # recently we turned off IPv6 because we suspect this causes our WiFi
5 # dropout problem. But then this hangs.
6 wget -O /tmp/calendar.$$.ics 'https://www.google.com/calendar/ical/adefaria%40gmail.com/public/basic.ics' >> /tmp/updateCalendar.$$.log 2>&1
7 #wget --no-check-certificate -O /tmp/calendar.$$.ics 'https://172.217.11.174/calendar/ical/adefaria%40gmail.com/public/basic.ics' >> /tmp/updateCalendar.$$.log 2>&1
8 wget -O /tmp/meetups.$$.ics 'http://www.meetup.com/events/ical/10426135/8dfdd0ffaaedecf720c5faf0cf3871b7ee5f5c1e/going' >> /tmp/updateCalendar.$$.log 2>&1
10 wget -4 -O /tmp/tripit.$$.ics 'http://www.tripit.com/feed/ical/private/06C4F90D-EFEFB9C5FDB17EC5FCB327DE31A54D96/tripit.ics' >> /tmp/updateCalendar.$$.log 2>&1
12 # Now let's combine the files. First strip off the END:CALENDAR from the main
14 filesize=$(wc -l /tmp/calendar.$$.ics | cut -f1 -d' ')
16 head -n $lines /tmp/calendar.$$.ics > /tmp/calendar2.$$.ics
17 mv /tmp/calendar2.$$.ics /tmp/calendar.$$.ics
19 # Now extract the middle of the next calendar
20 # Note, if we have nothing RSVPed here for Meetup then the file should be skipped.
21 # We will get an .ics file but it'll be short - less than 27 lines
22 filesize=$(wc -l /tmp/meetups.$$.ics | cut -f1 -d' ')
24 if [ $filesize -gt 27 ]; then
27 # Get the top portion...
28 tail -n $lines /tmp/meetups.$$.ics > /tmp/meetups2.$$.ics
30 # Now strip off END:VCALENDAR
31 let lines=filesize-27-1
33 head -n $lines /tmp/meetups2.$$.ics >> /tmp/calendar.$$.ics
36 rm -f /tmp/meetups2.$$.ics
39 # Now extract the middle of the next calendar
40 filesize=$(wc -l /tmp/tripit.$$.ics | cut -f1 -d' ')
42 if [ $filesize -gt 27 ]; then
45 # Get the top portion...
46 tail -n $lines /tmp/tripit.$$.ics > /tmp/tripit2.$$.ics
48 # Now strip off END:VCALENDAR
49 let lines=filesize-27-1
51 head -n $lines /tmp/tripit2.$$.ics >> /tmp/calendar.$$.ics
54 rm -f /tmp/tripit2.$$.ics
57 # Now add END:VCALENDAR to calendar.ics
58 echo "END:VCALENDAR" >> /tmp/calendar.$$.ics
61 mv /tmp/calendar.$$.ics ~/Documents/calendar.ics
63 # Get rid of stupid CRs
64 dos2unix -q ~/Documents/calendar.ics
69 rainlendar2 > /tmp/rainlendar2.log 2>&1 &
75 /tmp/updateCalendar.$$.log