Build a Twitter bot with Python
Today I was additionally occupied with how I could create a Twitter bot for a project. Once again Python and the package tweepy are the best choice.
The basic framework is quickly created with
apt-get install pip
pip install tweepy
installed.
For my Twitter bot I then only had to write the appropriate Python script and put it into a *.py file.
The script can be used at the end like all other Python scripts with
python3 /root/script.py
can be started.
The script then looks like this, for example:
Otherwise, a developer account with elevated access must be created on Twitter. Under this, a standalone app with OAuth 1.0a can then be created. As URL we only enter
https://twitter.com
in.