Things to do

Get registered with Twitter

And you should also have a "bot" account, not your true twitter account, but one that you can send tweets through. The next step is to register that bot account as a user of that Twitter app you just created (you will need to be able to operate two browsers at once):

By the end of it, you should have some kind of credentials file somewhere on your file system. DO NOT put it in your compjour-hw repo, or else it will be pushed onto the Github server! Save it somewhere like:

Write your own bot.py and foo.py

In foo.py, define functions that pertain to the steps that you think you'll run. You don't have to write any real code, but you do have to include a docstring comment that explains, briefly:

What the function does

What arguments it takes, and what the types of those arguments are

What the function returns

Some examples:

defmake_yolobro_text():"""
Create a custom #YOLOBRO happy message
Arguments:
None
Returns:
A text string with the #YOLOBRO hashtag and something extra special
"""ifrandom()>0.7:return"#YOLOBRO YOU MY BRO!"else:return"#YOLOBRO YO YO"deflatest_yolobro_reply(tweets):"""
Given a list of tweets (ostensibly from user_timeline API endpoint),
find the earliest one that has the #YOLOBRO hashtag in it
Arguments:
tweets (list): a list of Twitter tweet objects that are dicts
Returns:
if any such tweet is found, return that tweet (dict)
else, return None
"""fortweetintweets:tags=[tagfortagintweet['entities']['hashtags']iftag['text'].upper()=='YOLOBRO']iflen(tags)>0:returntweet

In bot.py: this should contain a single function, make_it_so(), and any other dependencies (such as importing foo.py and twit_utils.py). The steps you plan to take will run in the body of that make_it_so() function

The twit_utils.py file is meant for your usage, so that you don't have to become a master of the Twitter API to just send out a tweet, or search for things.