O'Reilly logo

Python Programming with Raspberry Pi by Srihari Yamanoor, Sai Yamanoor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The application of requests - publishing events to the Internet

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 Slacka 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required