Monitoring Twitter/e-mails to blink an LED
The Internet of Things concept is all about connecting the Web with the physical world. This goes in both directions: the data collection of physical devices goes up, and information from the Internet can be communicated out to physical devices. We can build on our previous example and have our LED circuits notify us when we receive an e-mail or tweet!
Getting ready
For hardware, you can use the same circuit as the previous recipe's circuit. Instead of a yellow LED, I used a blue one to notify me of Twitter messages.
If you followed the recipe in Chapter 4, Sending an e-mail from a Python Script, you should already have an app password for your Gmail account. If not, you can find out how in the Getting Ready section of the recipe.
I also used the Python library tweepy
to manage incoming tweets. You can install this using pip:
sudo pip install tweepy
Lastly, you will need a Twitter account and authorization keys.
Log in to your Twitter account, and go...