responsebot.models

Entity classes for various entity types for ResponseBot

Classes

Tweet(data) Represents a tweet.
User(data) Represents a user.
TweetFilter([track, follow]) Define criteria to filter tweets from Twitter’s public stream.
Event(data) Represent a user events (e.g.
class responsebot.models.Event(data)

Represent a user events (e.g. following, unfollowing, etc.). See more here and here.

__init__(data)
Parameters:data (dictionary) – Parsed JSON data
class responsebot.models.List(data)

Represent a user list.

__init__(data)
Parameters:data (dictionary) – Parsed JSON data
class responsebot.models.Tweet(data)

Represents a tweet. E.g. you can get a tweet’s text via it’s text property (tweet.text). All properties except retweeted_status, quoted_status, quoted_status_id_str, in_reply_to_status_id and in_reply_sto_status_id_str have the same name as Twitter defined them here. retweeted_status is renamed to retweeted_tweet, similar for other properties above.

__init__(data)
Parameters:data (dictionary) – Parsed JSON data
class responsebot.models.TweetFilter(track=[], follow=[])

Define criteria to filter tweets from Twitter’s public stream. See track and follow parameters in here.

__init__(track=[], follow=[])
Parameters:
  • track – A list of keywords to follow (each could also be a @mention or a #hashtag)
  • follow – A list of user ID strings to follow
Returns:

match_tweet(tweet, user_stream)

Check if a tweet matches the defined criteria

Parameters:tweet (Tweet) – The tweet in question
Returns:True if matched, False otherwise
class responsebot.models.User(data)

Represents a user. E.g. you can get a user’s screen name via it’s screen_name property (user.screen_name). All properties except status have the same name as Twitter defined them here. status is renamed to tweet.

__init__(data)
Parameters:data (dictionary) – Parsed JSON data