AC connotes delivery of electricity, but in this case is short for article-to-campus.
You provide a URL to a news article on news.ucsc.edu, and AC
- Fetches the HTML from the URL
- Sanitizes the HTML (remove unnecessary tags and attributes, make links fully-qualified)
- Pulls author and audience information out of the HTML
- Modifies the HTML (removes images, sharing links, and author information)
- Compiles a new template for the email and inserts the HTML
- Inlines a new CSS stylesheet so the message works with email clients like Gmail
- Uses the URL slug (filename on the website) to save the file in
./build/
- Node and NPM installed
- Command line experience
- Clone this repo
cd
into the project directory- Run
npm install
Run the following command to fetch a page:
node app.js [URL-to-fetch]
Example:
node app.js https://news.ucsc.edu/2019/07/frank-honduras-book.html
Prepares and saves the HTML content in ./build/frank-honduras-book.html
- Modularize the individual parts of the script.
- Make this into a full app that can send email too.
- Remove the requirement that the file be saved before inlining.
- Using Google Groups to send campus broadcasts (UCCSC, 2013).