Now you can createcredentials.py file and paste your credentials from Twitter API site.
Now we can start working on the script.I've added a
try ... except
block to our code, and have the console print out the reason for the error.This will help to avoid duplicated tweets and keep programme running if we will find errors. One more thing we should add is sleep() to ensure that these tweets don’t all go out at once. The function sleep() works with the time unit measure of seconds, so if we want an hour between tweets, we should write the function as sleep(3600) because there are 3,600 seconds in an hour.
No comments:
Post a Comment