My Raspberry Pi likes to pick (pseudo)random things, so I’ve built a couple of programs that allow it to do just that. I setup the Twitter account @RandomBerryPi so that it can share everything it does with the world. I have created two programs so far that run on my Raspberry Pi and tweet various random things. You can find the code and additional details about how they were constructed and deployed on my GitHub page here: https://github.com/danksalot/RandomBerryPi
RandomTweet.py is a program that is posting to Twitter as @RandomBerryPi. It uses Python to choose a random number, perform a virtual coin flip, and choose when it will post next. Like this:
A happy random number is 43369323 and a virtual coin landed on tails. Next update in 20 hours and 38 minutes. Have a random day!
— RandomBerryPi (@RandomBerryPi) June 11, 2016
The range for the random number is 10,000,000 – 99,999,999. The coin flip can be heads or tails. The next update can be anywhere from one minute to 23 hours and 59 minutes.
The program posts these to Twitter then waits the decided amount of time before running again.
RandomPowerball.py is a program that is posting to Twitter as @RandomBerryPi. It uses Python to choose random lottery numbers for the Powerball lottery. It then checks if the last numbers it picked were winners or not and posts to Twitter. Like this:
Last time I would have lost everything playing Powerball. Wah Wah! Here are some new picks : 49 39 30 47 42 (26). Have a random day!
— RandomBerryPi (@RandomBerryPi) March 13, 2016