I considered setting up a static IP address for the Pi and essentially having it act like a server, but I was afraid that the extra network traffic (both intended and unintended) could hamper the Pi’s performance. I also thought of building a website where the Pi could send its data and then be viewed by anyone online, but I didn’t want to pay for the domain, hosting services, etc. For now, I’d just rather have some 3rd party website manage and disseminate my data. That’s where Twitter comes in.
I found Twython, which is a Python library for managing a Twitter account. It allows you to post text, pictures, and videos and probably do a bunch of other things that I didn’t take time to learn about since I will be just posting text (maybe a webcam later though…). I signed up for a new Twitter account so that I don’t spam my current followers. Twython requires you to set up a new Twitter application at dev.twitter.com and record the consumer and access keys in your script. There is a good tutorial HERE. After that, you can compose a Tweet with a single Python command.
The tweet.py script that I wrote ingests the current conditions from current.txt and outputs them (nicely formatted) to Twitter. It serve a few other functions like converting to Fahrenheit, calculating relative humidity, converting to sea-level pressure, and converting wind speeds from rpm to mph. The script is run every 10 minutes with Cron.