send_igtwitter module¶
- class send_igtwitter.SpoolSendTwitter¶
Bases:
Spooler
- check_antiquity(limit_date_time)¶
Checks the age of an event and validates it with
limit_date_time
.- Parameters:
limit_date_time (obj) – datetime object
- Returns:
True
- Returns:
False
- Return type:
boolean
- connect_twitter(token_dict)¶
Takes a
token_dict
which is a dictionary of tokens and is then used to authenticate to the twitter api- Parameters:
token_dict (dict) – token dictionary
- Returns:
twitter_api
- post_event(twitter_api, event_dict)¶
Takes a
twitter_api
object to use api twitter and then publish a tweet with info of event_dict- Parameters:
twitter_api (obj) – object that contains credentials of authentication for the Api twitter
event_dict (dict) – event dictionary
- Returns:
tweet_id.id
- Return type:
int
- spool(addresses, content)¶
Take an addresses list and check against the DB if the event has been published alredy, also read the content element with a
bulletin object
to extract info about the event- Parameters:
addresses (list[str]) – list.
content –
- Returns:
True
- Returns:
False
- Return type:
boolean
- class send_igtwitter.TwitterConfig(config)¶
Bases:
object