In the previous example, we retrieved information from the Internet. Let's consider an example where we have to publish a sensor event somewhere on the Internet. This could be either a cat door opening while you are away from home or someone at your doorstep stepping on the doormat. Because we discussed interfacing sensors to the Raspberry Pi Zero in the previous chapter, let's discuss a scenario where we could post these events to Slack—a workplace communication tool, Twitter, or cloud services such as Phant (https://data.sparkfun.com/).
In this example, we will post these events to Slack using requests. Let's send a direct message to ourselves on Slack whenever a sensor event ...