Twitter bots: automated programs that interact with a popular social network, often responding to hashtags and events based on predefined settings. For example, I could use a Twitter bot to track down mentions of my posts and retweet them.

But what if you have a Twitter bot running on hardware like the Raspberry Pi? This would enable real-world alerts and notifications from the copycat’s virtual Facebook microblogging; You can look at a physical count of the number of hashtag mentions, perhaps, or flash a few lights.

Users have found many ways to interact with Twitter using the Raspberry Pi. To get started, check out our very own Raspberry Pi Twitter bot project, then read about the following 10 projects to see how you can spin your own…

Tweet the status of your pi

When we came up with the idea of ​​Twitter bot projects, our own expert James Bruce suggested using the Raspberry Pi to tweet hardware status (such as CPU temperature) and photos from the device’s webcam. (see link above).

It uses a custom Python application built with the Twitter API and uses the crontab command to schedule repeat tweets. We recommend that you take a look at this guide before moving on to the other projects listed here, as it will give you a good idea of ​​the basics required to build a Twitter bot.

Simple retweet bot

One of the most important things you can do on Twitter is retweet. This may be to show your support for a cause, highlight your admiration for something, or promote a business venture. Whatever the reason, it can be a little distracting doing manual retweets all the time.

Luckily, there are various tools to help you automate the retweet process, not least creating a Raspberry Pi retweet bot that will do the job for you. With a simple Python script and the Twitter API, you can create a bot that retweets based on the hashtag of your choice.

Tweet your Speedtest results

If you need to convince yourself of the power and potential of a Twitter bot, take a look at this tweet:

The idea behind the bot, created by a Twitter bot programmed by Reddit user AlekseyP, is to determine the download speed of the Comcast network, of which he is a subscriber. When the downgrade rate drops below 50 Mbps (the user pays 150 Mbps down and 10 Mbps up), a tweet is sent.

The code is available on Pastebin. As AlekseyP points out, «I know some people might say that I shouldn’t complain about 50Mbps, but when they advertise 150 and I get 10-30, I’m not satisfied.» Interestingly, this approach seems to have worked.

“I set it up because I was frustrated with a period of constant drops and outages. Much better now. Previously, we couldn’t stream Netflix and I wouldn’t be able to connect to CSGO matches [Counter-Strike: Global Offensive] «.

Flash LED when you receive a direct message or retweet

Instead of tweeting and retweeting, how about using your Pi as a Twitter monitor that physically responds to triggers from other tweets? To do this, you will need a Raspberry Pi, a breadboard, a resistor, and an LED, as shown in this tutorial.

While projects earlier on this list used hashtags for selective retweeting, this project uses them to light up an LED. It’s fair to say that this isn’t the most imaginative use of a Raspberry Pi and some LEDs, but it’s really just the tip of the iceberg of what can be achieved by connecting a Raspberry Pi to Twitter. Other notification options could include playing a sound (perhaps even a car horn, as shown on the project page!), and this project is a good place to start if you have an aspiration to control a Pi-connected robot via Twitter.

Tweet my roar

Based on a standard dinosaur toy, this project is sort of a continuation of the previous one. However, instead of blinking, it uses Python code to detect @mentions of Boris the dinosaur’s dedicated Twitter account and make him roar in response.

This is well demonstrated in this video.

Obviously, the dinosaur could already growl. The project uses the existing hardware and essentially passes the on/off command to the dinosaur. Although the result is quite different, it is essentially the same as blinking an LED.

You will find a code example on the Tinoet Dino page.

Tweet how your garden grows

Finding interesting things to automatically tweet with your Raspberry Pi can be tricky. So why not take a look at existing Raspberry Pi projects? One example is the urban agriculture Tweetbot, which tweets garden images, water levels and soil moisture data.

The project was built using Raspberry Pi Model B+ so the Raspberry Pi 2 needs to be worked with a few changes. and Raspberry Pi 3 models. Of course, you don’t need to cultivate hydroponically to use this project — it can also be easily set up in your greenhouse or in your veggie patch.

Manage your fish

Fisheries management is an often overlooked aspect of pet ownership. If you’re worried that your goldfish (or other aquatic animals) aren’t experiencing the right temperatures, why not set up your Raspberry Pi to detect the temperature, take a photo, and post the results?

Although there is no set of instructions for this, it is quite similar to what we have already seen with the garden twitter bot above. It also demonstrates that while there are very few original ideas left to reveal, the Pi-powered Twitter bot is consistently impressive.

Listen to your tweets

What are the tweets really saying? If you don’t have time to read, or can’t find the Raspberry Pi robot on Twitter, which aims to find relevant tweets and read them for you, this might be especially helpful. You’ll find the TwitterPiBot software and schematic on GitHub, and if you have an audio output connected to your Raspberry Pi, tweets with the specified hashtag will be read to you. You can change the project to read tweets through the Sonos system. easier too.

When properly configured, it is also a means to ensure the delivery of news and information, such as your personal radio station!

Get International Space Station Alerts

Where is the International Space Station located today? It’s hard to see without looking outside, but this Raspberry Pi Twitter bot uses an RSS feed generated by NASA’s ISS Observation Web Page to predict when the space station will be visible from your part of the world and send a tweet the day before . In this way, everyone who is interested in looking at the sky will be able to prepare for astronomical observations.

Considering that — at the time of writing — two Raspberry Pis orbit the Earth on the ISS, this project seems particularly appropriate.

False Policies

They enter politics with noble goals, but become outcasts. Yes, they are politicians, and Twitter bots can be set up to ridicule these self-serving «civil servants». Could there be a better way to use the Raspberry Pi? One such example is Reddit user «Shut-Up-Tyler» who created an automated satire (comedians, an earthquake in your boots) for this project.

So how does it work?

“My program runs on a Raspberry Pi with Python. It uses BeautifulSoup to extract tweets from Mr. Trump’s page, removes links with regular expressions, uses a function to replace the words «doot doot» and «trumpet», puts them in a markov chain… and outputs them on Twitter.»

Sometimes tweets are nonsense. Unfortunately, this makes them very difficult to distinguish from real Trump tweets.

No doubt there are plenty of other ways you can use the Raspberry Pi based Twitter Bot — so why not tell us about yours in the comments?

Похожие записи