Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Allows you to create bots for turntable.fm.

Project Description
## Installation

### Using pip

pip install ttapi

### Via source

Obtain the source by downloading from the web or cloning with git. In the
directory containing setup.py run:

python setup.py install

## Examples

### Chat bot

This bot respond to anybody who write "/hello" on the chat.

```py
from ttapi import Bot
bot = Bot(AUTH, USERID, ROOMID)

def speak(data):
name = data['name']
text = data['text']
if text == '/hello':
bot.speak('Hey! How are you %s ?' % name)

bot.on('speak', speak)

bot.start()
```

### Simple

```py
from ttapi import Bot
bot = Bot(AUTH, USERID, ROOMID)

# Define callbacks
def roomChanged(data): print 'The bot has changed room.', data
def speak(data): print 'Someone has spoken.', data
def updateVotes(data): print 'Someone has voted.', data
def registered(data): print 'Someone registered.', data

# Bind listeners
bot.on('roomChanged', roomChanged)
bot.on('speak', speak )
bot.on('update_votes', updateVotes)
bot.on('registered', registered )

# Start the bot
bot.start()
```
Release History

Release History

This version
History Node

1.2.0

History Node

1.1.1

History Node

1.1.0

History Node

1.0.0

History Node

0.1

History Node

0.1dev

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ttapi-1.2.0.tar.gz (6.9 kB) Copy SHA256 Checksum SHA256 Source Mar 24, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting