Unable to think what to tweet about? Have you ever faced a similar situation?

Well, it’s very easy to create your own bots using python’s Tweepy module. You can use these skeletons I recently made for a workshop on the same topic. All you need to make your own bot is add some logic to these skeletons.
This is a basic static script that you can use by running once yourself or setup a cronjob to run automaticaly in intervals. Currently, it fetches JSON data from an API and parses it into a python dict which you can then manipulate with your py-fu.
#[email protected]>
=
=
=
#convert to py dict
=
#uncomment to explore the dictionary
#print(res)
=
= + + + ++
#print(tweet)
#uncomment to update twitter status
#fill this in to loop over the list
#for i in res["ongoing"]:
#print(i)
This script uses twitter’s streaming API which you can use to read content in real time and act upon it again, in real time!
#[email protected]>
global
""" A listener handles tweets that are received from the stream.
This is a basic listener that just prints received tweets to stdout.
"""
#this line parses the json data into a python dictionary
=
#uncomment this to explore the dictionary
#uncomment this to just see the text of the tweet, simlarly you
#can see the other fields of the dict
#print('test: ' + d["text"] + '\n')
#uncomment to to tweet from your twitter bot
#although before tweeting you might want to implement
#command parsing and your logic
#api.update_status(status='[ACMSNUBOT] ' + d["text"])
return True
=
=
=
=
#change filters to listen to various types of tweets
#eg try 'coldplay', '@rhnvrm', '#ACMSNU' etc
Note you will also need this file in the same directory, it holds your keys. You should add this file to .gitignore before commiting your keys in your own repo.
# Go to http://apps.twitter.com and create an app.
# The consumer key and secret will be generated for you after
=
=
# After the step above, you will be redirected to your app's page.
# Create an access token under the the "Your access token" section
=
=
If you create your own bot using this, we would love for you to also add it to the audience folder in the repo by sending a pull request.