Simple Twitter Bot (Plus a quick Pi giveaway)

Published on: March 13, 2021

Tl;dr: Tweet @PiPyPie with hashtag #PiDayGiveaway to enter for a chance to win a free Raspberry Pi Zero W. Be sure to read the rules of the giveaway.

Welcome to the 23rd Raspberry Pi video! This is a demo like a few of my other ones because we just want to celebrate Pi Day with a simple Twitter Bot named PiPyPie. My goal was to make it as simple as possible but let it handle complex operations. Some highlights:

  • Respond to tweets made to the bot with certain hashtags
  • Make the configuration as easy as possible so that adding new hashtags as easy as possible 
  • Make it easy to install and manage

That's pretty much it. The code itself is very simple, in total it's less than 70 lines of actual code which includes authentication.  The video highlights the features as well as how to add a new hashtag. If anyone is interested in an actual code walkthrough, let me know, I'm happy to set aside some time to do a quick how-to video. 

For the code and more detailed instructionson how to configure the bot, check out the code on GitHub at https://github.com/naztronaut/PiPyPie

Have questions or want to add a joke? Let me know in the comments below! Now you're probably wondering how to enter the giveaway. 

Giveaway

Between 2018 and 2019, I gave away about 18 Raspberry Pi Zero Ws. On Pi day, I'll give away at least one Pi Zero W. Due to the pandemic, it's been very difficult to get my hands on more Pis to give away but I got one and it can be yours! 

Here are the contest rules:

  • Must be from the US (sorry, still need to keep my shipping costs low)
  • Tweet at @PiPyPie with the hashtag #PiDayGiveaway - you can say anything you want or just tweet the hashtag
  • Follow @PiPyPie so that I can DM you if you win
  • Limit 1 entry per twitter account. I don't have means to check for duplicate accounts so if you have the energy to create 100 accounts and enter 100 times, then so be it. But please try to be fair to everyone else. I will try to do more giveaways in the future! 
  • Tweets must be made by 3:14 PM PST (6:14 PM EST) 
  • Winner will be announced here and on Twitter the following day

If you have any questions, feel free to ask. Best of luck to everyone!

WINNER: Congrats to @magicentral on twitter for winning the Raspberry Pi Zero W! 

Patreon

I do these projects to learn and teaching is a good way to learn. But if you do want to support me, head on over to Patreon and become a Patron: https://www.patreon.com/nazmus

If you've implemented this project, I'd like to see it! So please share it with me through any of my regular channels. 

Remember to checkout the Resources section below for associated downloadable content, JSFiddle links, and other resources. Watch the video and follow along!

Resources:

Find the code on Github: https://github.com/naztronaut/PiPyPie

Follow the bot on twitter: @PiPyPie



Comments: