mirror of
https://github.com/alexellis/seeds2.git
synced 2022-05-09 04:08:56 +03:00
18 lines
508 B
Python
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)
|
|
|