![]() using the combined power of Africas Talking and python you can easily handle sending one, a few or a lot of messages. Now we can Finally run python multiple-sms-csv.py and watch the output on the terminal. However, its not uncommon for messages to fail due to a variety of reasons hence I added a try block and get notified via the terminal and retry later. We then create a message variable to hold our customized message. I could ofcourse have hard-coded the date as a string,however I wanted this script to be reusable and easy make modifications going The meeting was scheduled for 5 days from the current day, using the datetime module I did quick calculations using the timedelta() function. Instagram-mass-reporter is a Python library typically used in Testing. Inorder to send messages to each member we need to iterate over each row, however the first row is just default column headers thus we need to skip them hence: if number != "Number: Introduce Instagram Report Bot (send a lot of reports automatically) TopNotch. We then proceed to assign variables to each value. From each row we get the value of name and numbers using list unpacking, this will ofcourse change based on the layout of your csv. Inside the function we open the csv and use the reader() function from the inbult csv module to parse each row. The above code creates a function send_messages(). env and enter the following replacing the placeholders with your account credentials: Let's add those credentials now.Ĭreate a file called. Needed to authenticate with the Africas talking API. On how to use environment variables in python.įor this use case I am using the python-dotenv package to store the credentials Our credentials in a separate file for security reasons. In this case it's the africastalking python sdk and python-dotenv module to aid keeping ![]() github python bot instagram script python-script python3 p圓 python-3. Line 4 and 5 uses built-in python package manager, pip to install the required modules. Ever wanted to send hundreds of the same text message to a friend or several. ![]() Recommend or pyenv-win for Windows users. You don't have to use theĭefault venv module, pyenv is a great alternative I would The main python system version as well avoid version conflicts. I'll breakdown the code above, Line 1 and 2 creates a working directory and changes into the directory.įollowing best practices, in line 3 and 4 we create and activate virtual environment to prevent cluttering Enter fullscreen mode Exit fullscreen mode ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |