BaySec website source
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

49 lines
1.3 KiB

  1. #!/bin/sh
  2. #
  3. # Script to generate the next Baysec meetup
  4. #
  5. set -e
  6. dir=content/meetups
  7. TZ=America/Los_Angeles
  8. export TZ
  9. i=$(grep -h event_start "$dir"/2* | sort | tail -n 1)
  10. i=${i#*: }
  11. esecs=$(date -j -v1d -v+1m -v+tue -v+2w -f %Y%m%dT%H%M%S "$i" +%s)
  12. gensecs=$(date +%s)
  13. echo Generating meetup at $(date -r $esecs)
  14. dmnth=$(date -j -r $esecs +"%d" )
  15. case $dmnth in
  16. 01|21|31)
  17. ending="st";;
  18. 02|22)
  19. ending="nd";;
  20. 03|23)
  21. ending="rd";;
  22. *)
  23. ending="th";;
  24. esac
  25. cat <<EOF > "$dir/$(date -j -r $gensecs +"%Y-%m-%d")-$(date -j -r $esecs +"%B").html"
  26. ---
  27. title: "Next BaySec: $(date -j -r $esecs +'%B %e'$ending', %Y')"
  28. layout: patriothouse
  29. event_summary: Baysec
  30. event_timezone: $TZ
  31. event_start: $(date -j -r $esecs +"%Y%m%dT190000")
  32. event_end: $(date -j -r $esecs +"%Y%m%dT230000")
  33. event_location: Patriot House Pub
  34. created: !!timestamp '$(date -j -r $gensecs +"%Y-%m-%d %H:%M:%S")'
  35. ---
  36. Baysec will be at the Patriot House Pub in SF, starting at 7 pm and usually
  37. ending some time after 10 pm.
  38. <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3152.7895438057476!2d-122.40109834914308!3d37.794971618670836!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x80858061009fbe67%3A0xaca3e8d9f06b5f8e!2sPatriot+House+Pub!5e0!3m2!1sen!2sus!4v1483420387349" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
  39. EOF