Bundling up tweets and sending emails

The twitter Monitor project is slowly starting to come to get to a usable point, and now zips up the folder containing the tweets and filtered results and can now email these results to who ever would like them.

To zip the folder up I have used the subprocess library to run a command line program and create the zip function.

Getting the program to email this file to me however was a much more complicated task, not because the details are difficult to find, more trying different things until I found a solution that worked for my email server. In the end I settled on:

I have left in my debugging outputs as comments from when I was struggling to get this to work.

Next step is to set this program up to run every day on a machine, but im not currently sure if i want to run it on my machine or set up a little headless server somewhere to do that.

Hear is the current version of the code in its entirety.

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *