GeometrizeTwitterBot  1.0
Python Twitter bot for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables
Functions | Variables
bot Namespace Reference

Module that sets up the Geometrize Twitter bot. More...

Functions

def on_connect
 Callback triggered when the stream listener connects. More...
 
def on_timeout
 Callback triggered when the stream listener times out. More...
 
def on_error
 Callback triggered when the listener encounters an error. More...
 
def on_on_demand_status_event
 Callback triggered when the stream listener for the Geometrize bot account reports a status event. More...
 
def on_account_watcher_status_event
 Callback triggered when the stream listener for tracking specific Twitter accounts reports a status event. More...
 
def on_on_demand_filter_setup
 Callback triggered when setting up the stream filter for tracking the Geometrize bot account. More...
 
def on_account_watcher_filter_setup
 Callback triggered when setting up the stream filter for tracking specific Twitter accounts. More...
 

Variables

tuple tweepy_auth = tweepy.OAuthHandler(config.OAUTH_CONSUMER_KEY, config.OAUTH_CONSUMER_SECRET)
 
tuple tweepy_api = tweepy.API(tweepy_auth)
 
tuple on_demand_bot
 

Detailed Description

Module that sets up the Geometrize Twitter bot.

Invoke this script to run the bot i.e. "python bot.py".

Function Documentation

def bot.on_account_watcher_filter_setup (   stream)

Callback triggered when setting up the stream filter for tracking specific Twitter accounts.

72 
74  print("Setting up account watcher tweet filter...")
75  stream.filter(follow = config.TWITTER_BOT_WATCH_ACCOUNTS, async = True)
76 
77 # Create and set up the on-demand Geometrize bot.
# This bot waits for users to tweet images at the bot, which it then geometrizes.
def on_account_watcher_filter_setup
Callback triggered when setting up the stream filter for tracking specific Twitter accounts...
Definition: bot.py:72
def bot.on_account_watcher_status_event (   api,
  status 
)

Callback triggered when the stream listener for tracking specific Twitter accounts reports a status event.

62 
63 def on_account_watcher_status_event(api, status):
64  print("Received Twitter stream listener status event")
def on_account_watcher_status_event
Callback triggered when the stream listener for tracking specific Twitter accounts reports a status e...
Definition: bot.py:62
def on_account_watcher_status_event
Handles a status change event from the Twitter streaming API.
Definition: on_status_event.py:122

Here is the call graph for this function:

def bot.on_connect (   api)

Callback triggered when the stream listener connects.

43 
44 def on_connect(api):
45  print("Twitter stream listener did connect")
def on_connect
Callback triggered when the stream listener connects.
Definition: bot.py:43
def bot.on_error (   api,
  code 
)

Callback triggered when the listener encounters an error.

52 
53 def on_error(api, code):
54  print("Encountered Twitter error response: %s" % code)
55  return True
def on_error
Callback triggered when the listener encounters an error.
Definition: bot.py:52
def bot.on_on_demand_filter_setup (   stream)

Callback triggered when setting up the stream filter for tracking the Geometrize bot account.

67 
68 def on_on_demand_filter_setup(stream):
69  print("Setting up on demand tweet filter...")
70  stream.filter(track = [config.TWITTER_BOT_USERNAME], async = True)
def on_on_demand_filter_setup
Callback triggered when setting up the stream filter for tracking the Geometrize bot account...
Definition: bot.py:67
def bot.on_on_demand_status_event (   api,
  status 
)

Callback triggered when the stream listener for the Geometrize bot account reports a status event.

57 
58 def on_on_demand_status_event(api, status):
59  print("Received Twitter stream listener status event")
def on_on_demand_status_event
Callback triggered when the stream listener for the Geometrize bot account reports a status event...
Definition: bot.py:57
def on_on_demand_status_event
Handles a status change event from the Twitter streaming API.
Definition: on_status_event.py:64

Here is the call graph for this function:

def bot.on_timeout (   api)

Callback triggered when the stream listener times out.

47 
48 def on_timeout(api):
49  print("Twitter stream listener did time out")
50  return False
def on_timeout
Callback triggered when the stream listener times out.
Definition: bot.py:47

Variable Documentation

tuple bot.on_demand_bot
Initial value:
2  tweepy_auth,
3  tweepy_api,
4  on_connect,
5  on_timeout,
6  on_error,
7  on_on_demand_status_event,
8  on_on_demand_filter_setup)
Definition: geometrize_bot.py:8
tuple bot.tweepy_api = tweepy.API(tweepy_auth)
tuple bot.tweepy_auth = tweepy.OAuthHandler(config.OAUTH_CONSUMER_KEY, config.OAUTH_CONSUMER_SECRET)