6/29/2023 0 Comments Dyno bot twitter![]() requirements.txt - list of all the dependencies.gitignore - for hiding the virtual environment and. env_load.py - code for calling the twitter API keys using os and python-dotenv.bot.py - where the actual code for the bot is written.images/ - folder to store sketch generated images.Now, I added all the important files for this project inside twitter-sketch-bot folder! Let's review each file's context below : ![]() Third, Adding all of the above dependencies in requirements.txt file : pip freeze > requirements.txt Pip install requests tweepy python -opencv pillow python -dotenv numpy Second, Installing all the required packages inside the new environment : Source means the hard drive where I have created the directory. venv module creates a new directory called sketch-bot where all the required packages will be installed.Coding in a virtual environmentīefore installing the packages, the utmost important task is to create a virtual environment - a directory that will contain all the necessary project files for the project to run.įirst, I created a directory named twitter-sketch-bot and then I used the below commands to create and activate the virtual environment using Command Prompt : python -m venv sketch -bot To generate & save Access Token and Access Token Secret keys, I went back to my project dashboard, clicked on my project, then clicked on the key icon of my app!Īll these keys were stored in a secure location for later use. Once I have confirmed my account, it generated - API Key, API Key Secret, and Bearer Token for my app. After following all the instructions, the Elevated Access feature is unlocked. Next, I had to set up my Twitter Developer Profile (logged in with account to be used) and create an app inside it. I had to create a separate Twitter account so that it can Tweet on its own behalf. In this article, I'm going to introduce you to the code I wrote for building a Twitter bot and deploying it using one of the best free cloud hosting platform called, Heroku!Īt the end, I'll share my learnings gained by building this project! □
0 Comments
Leave a Reply. |