1
0
mirror of https://github.com/alexellis/seeds2.git synced 2022-05-09 04:08:56 +03:00
Files
seeds2-plant-monitoring/tweeter.py
Alex Ellis dff4ec3be5 Initial
2017-06-15 07:39:33 +01:00

18 lines
508 B
Python

class Tweeter:
def __init__(self, config, tweepy):
self.tweepy = tweepy
self.config = config
def send(self, filename, status_text):
ckey = self.config["ckey"]
csecret = self.config["csecret"]
akey = self.config["akey"]
asecret = self.config["asecret"]
auth = self.tweepy.OAuthHandler(ckey, csecret)
auth.set_access_token(akey, asecret)
api = self.tweepy.API(auth)
api.update_with_media(filename, status=status_text)