Twitter is a wonderful communication and social media platform. It has everything: breaking news, political opinion, humor, celebrities, entertainment, special interest chat, and, well, anything. Individuals, companies, departments, projects, and more—really anyone or anything—can have a Twitter account. Some Twitter accounts are not even run manually by a person or a group of people—they're automated bots.
It's very simple to write a Twitter bot using Python—and a Raspberry Pi is the perfect tool to run the code; rather leaving a PC or laptop switched on permanently, you can leave your Raspberry Pi running 24/7 and hardly any power will be used. That said, if you don't have a Raspberry Pi, most of this tutorial will still work for you on a PC.
https://opensource.com/article/17/8/raspberry-pi-twitter-bot