This contains a script that scrapes the everyman cinema website for film listings and emails recipients with a neat HTML list of the showings and times
main.py
contains the main script to combine and run the functions contained in/modules
/modules
:everyman.py
contains a function to scrape and return data and a function to compose html to use in an emailmail.py
contains a function to send an html formatted email from gmail or hotmailfilm_template.py
contains strings containing html which are used in the everyman.py script to create the email body/config
:- NB a demo_config.json is included in the right format, but the actual config.json has been added to .gitignore for security
config.json
should contain a configuration file in json with:- An array of venues to scrape in lowercase and hyphen separated
- e.g.
['maida-vale', 'kings-cross']
- e.g.
- An array of email recipients to receive the email
- e.g.
['me@gmail.com', 'you@hotmail.com']
- e.g.
- Desired days and times
- Format is
{day_of_week: times, day_of_week: times...}
- Format is
- Write days in full e.g. "Monday" - "Sunday"
- Use strings in format "0000-2359" for start-end
- e.g.
{"Monday": "1800-2200"}
would mean show Monday films starting between 6 and 10pm
- Credentials of an email account (gmail or hotmail) to use
- Credentials should be inside a dictionary called 'email' with keys
gmail_user
andgmail_password
and/orhotmail_user
andhotmail_password
- Credentials should be inside a dictionary called 'email' with keys
- An array of venues to scrape in lowercase and hyphen separated
- Create the config file with the recipients, venues, email recipients and desired times (optional)
- Amend main.py if desired to adjust location of config file, any email parameters and location of python installation on first line
- Make the
main.py
script executable usingchmod +x 'path/to/file'
- Add to crontab using
crontab -e
to trigger on a regular basis
- Python 3.6+
- requests, beautiful soup (bs4) with lxml parser, smtp and email libraries
- A gmail or hotmail email account to send mail from.
- NB using gmail will require you to 'allow access to less secure apps'
- Fix issue of no matching times on a given day
- Rotten tomatoes API to show user and critic scores
- Improve email formatting, e.g. multiple columns
- Make configuration easier - add argparser to make it CLI compatible
- Parse and clean venue input - remove spaces and lower case
- Write a venue lookup function
- NICE TO HAVE
- Authenticate and book within the email!