您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1.3KB


title: Twitter bots using Tweepy author: rhnvrm type: post date: 2016-01-29T00:00:00+00:00 url: blog/2016/01/29/twitter-bots-using-tweepy/ categories:

  • projects

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 automaticall 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.


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!


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.

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.