Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Python library to build twitter bots. Create your bot like playing with constructor.
Python
branch: master

README.md

TweeBot v1.0

A Python library to build twitter bots over tweepy library. It's a very simple and flexible way to create your own bot.

Example

# Next code demonstrates how to create simple twitter bot that select all friends'
# tweets with your mentiones and retweet they. (See comments in code for more 
# details about how filters work.)

import tweebot as twb

def main():
    # Step 1. setup context configuration
    repeater = twb.Context({
        'app_name'        : 'repeater',
        'username'        : '<YOUR ACCOUNT NAME>',
        'consumer_key'    : '<YOUR CONSUMER KEY>',
        'consumer_secret' : '<YOUR CONSUMER SECRET>',
        'access_key'      : '<YOUR ACCESS KEY>',
        'access_secret'   : '<YOUR ACCESS SECRET>',
        'timeout'         : 1 * 60, # 1 min, ensure twitter api limits
        'history_file'    : 'history.json',
    })

    # Step 2. enable pretty logging
    twb.enable_logging(repeater)

    # Step 3. setup chain Selector->Filters->Action
    chain = (
        twb.SearchMentions(),
        twb.MultiPart.And(
            twb.BaseFilter,
            twb.UsersFilter.Friends(),
            twb.BadTweetFilter),
        twb.ReplyRetweet)

    # Step 4. start processing 
    repeater.start_forever(*chain)

if __name__ == '__main__':
    main()

Other

Something went wrong with that request. Please try again.