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.

gennext.sh 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. twittertitle: BaySec - $(date -j -r $esecs +'%B %e'$ending', %Y')
  29. description: Baysec will be at the Patriot House Pub in SF, starting at 7 pm and usually ending some time after 10 pm.
  30. twitterlabel1: Event
  31. twitterdata1: $(date -j -r $esecs +'%B %e'$ending', %Y')
  32. layout: patriothouse
  33. event_summary: Baysec
  34. event_timezone: $TZ
  35. event_start: $(date -j -r $esecs +"%Y%m%dT190000")
  36. event_end: $(date -j -r $esecs +"%Y%m%dT230000")
  37. event_location: Patriot House Pub
  38. created: !!timestamp '$(date -j -r $gensecs +"%Y-%m-%d %H:%M:%S")'
  39. ---
  40. Baysec will be at the Patriot House Pub in SF, starting at 7 pm and usually
  41. ending some time after 10 pm.
  42. <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>
  43. EOF