send_igfacebook module¶
- class send_igfacebook.FacebookConfig(config)¶
Bases:
object
- class send_igfacebook.SpoolSendFacebook¶
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_facebook(token_dict)¶
Takes a
token_dict
which is a dictionary of tokens and is then used to authenticate to Facebook Api- Parameters:
token_dict (dict) – token dictionary
- Returns:
facebook_api
- post_event(facebook_api, event_dict)¶
Takes a
facebook_api
object to use api facebook and then publish a post with info of event_dict.- Parameters:
facebook_api (obj) – object that contains credentials of authentication for the Api twitter
event_dict (dict) – event dictionary
- Returns:
post_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