This app creates a newsletter from the Meetup.com calendar.
Events are stored in the ./data/hackrva.sqlite
file.
- edit the
newsletter.json
file to update the values month, welcomeImageURL, mindate, and maxdate
"month": "December",
"welcomeImageURL": "december.png",
"mindate": "2022-12-01",
"maxdate": "2022-12-31",
- ensure there is a file in
html/<monthname>.png
for the banner - run:
./scripts/make-newsletter.sh <monthname>
- NOTE: the
monthname
is a double-check that you've updated thenewsletter.json
file
- NOTE: the
- The output HTML is in the
html/<monthname>.html
folder - Upload both the html and png files to the HackRVA.org wiki "Media" area
- Create a Post which points to the
<monthname
>.html` URL in the "Media" area
You can get an abbreviated newsletter with ./scripts/make-email.sh
Send to : HackRVA-Meetup-list@meetup.com
curl https://api.meetup.com/hackrva-meetup/events | jq > events.json
- This command
- calls the Web Service routine from Meetup.com
- formats it with
jq
(which is optional) - stores it in
events.json
- Meetup will send a year's worth of events that have not occurred in the past
./js/update-database.js events.json
- This Command
- reads the
events.json
- adds each record to the
data/hackrva.sqlite
flat-file database table
- reads the
- NOTE: It will overrite existing records with the same Meetup-event-id.
- If you do this twice a month, all the old and new events will be stored
- Meaning that updating the newsletter will work, and you can regenerate old newsletters
./js/extract-events.js > monthly-json/$month.json
- This Command
- gets the
mindate
andmaxdate
from thenewsletter.json
file - queries the
Event
table fromdata/hackrva.sqlite
- writes the event records to
monthly-json/$month.json
for the particular month
- gets the
./js/newsletter-merge.js monthly-json/$month.json > html/$month.html
- This Command
- combines the parts of the HTML template from the
template/
folder - replaces
{{fieldname}}
fields with values from each event in themonthly-json/$month.json
file - writes the output to the
html/$month.html
- combines the parts of the HTML template from the
open html/$month.html
- This Command
- is Mac-specific
- You'll have to change it for other OSs
- Or just double-click on the resulting
html/$month.html
file
- data/ - holds the
sqlite3
database - html/*.html - the resultant monthly newsletters are stored here
- html/*.png - the monthly 'header' .png files go here. YOU supply them.
- js/ - javascript files
- models/ - table definition for the tables. (Event.js)
- monthly-json/ - temporary storage for each month's events in JSON format
- scripts/ - bash shell scripts
- template/ - html fragments for the newsletter's HTML
- NOTE: the files are joined in alphabetical order
- NOTE: the
event-header.htm
andevent.htm
have{{macro}}
fields that are expanded for each event