twitools/filters/filler.py.dist

48 lines
1.4 KiB
Text
Raw Normal View History

2017-03-07 13:17:21 +00:00
"""
This file allows you to add your own hooks to the filler.py script without
having to mess around with the code.
"""
def tweetFilter(tweet):
"""
Code to be executed when a new tweet is found.
:param tweet: tweepy.Status object for the new tweet
:return: True if the tweet should be stored in the database, else False
"""
return True
def messageFilter(message, incoming):
"""
Code to be executed when a new incoming or outgoing message is found.
:param message: tweepy.DirectMessage object for the new message
:param incoming: True if the message is incoming (not sent by us), else False
:return: True if the message should be stored in the database, else False
"""
return True
def followerFilter(follower, current):
"""
Code to be executed when a follower is gained or lost.
:param follower: Integer ID of the following account
:param current: True if they started following, False if they unfollowed
:return: True if the following/unfollowing action should be stored, else False
"""
return True
def followingFilter(following, current):
"""
Code to be executed when we start or stop following another account.
:param following: Integer ID of the account we follow/stopped following
:param current: True if we started following, False if we unfollowed
:return: True if the following/unfollowing action should be stored, else False
"""
return True