A python script that generates a daily briefing email ideal for having Siri or OS X's speech tools read back to you.
I always recommend using virtualenv and virtualenvwrapper and so I've only done the following inside a virtualenv.
pip install -r requirements.txt
(installs feedparser, nltk and their dependencies.)- run
./brief.py --nltk-first-run
to install the necessary nltk corpora and tokenizers (used for the summarization feature) - create a file called brief.config that will hold the configuration values in a JSON format.
Here's a sample of what the contents should look like:
{ "name": "Sir", "from": "[email protected]", "to": "[email protected]", "feeds": { "headlines": "http://www.npr.org/rss/rss.php?id=1001", "weather": "http://w1.weather.gov/xml/current_obs/KBFI.rss" }, "smtp": { "host": "localhost" } }
(It should be noted that the script is over-optimized for weather.gov and npr.org feeds.)
If you'd like to see what the output will look like or want to pipe the output somewhere
else use the --to-text
flag.
Presumbly you'll want to have a cron job send this every morning:
0 7 * * * the/path/to/brief.py
That's really it for now. There should probably be more options and such.