From 4c40cbcfe928806ffdf9446030561cc241667c9a Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Mon, 23 Sep 2013 22:43:06 +0200 Subject: [PATCH] this twitter stuff sucks. doesn't work actually --- lib/tasks/tweet.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/tasks/tweet.py b/lib/tasks/tweet.py index c8a4234..0c58fd2 100644 --- a/lib/tasks/tweet.py +++ b/lib/tasks/tweet.py @@ -1,8 +1,10 @@ """ The tweet/twitter task. + +Uses: tweepy """ -import twitter +import tweepy from lib.tasks.task import Task @@ -15,13 +17,11 @@ class TweetTask(Task): self.set_task_type(kwargs["type"]) self.recipient = kwargs["args"]["rcpt"] - def execute(self, msg): - api = twitter.Api(consumer_key='consumer_key', - consumer_secret='consumer_secret', - access_token_key='access_token', - access_token_secret='access_token_secret') - status = api.PostUpdate(msg) - pass + def execute(self, msg, core): + auth = tweepy.BasicAuthHandler("user", "pass") + api = tweepy.API(auth) + api.update_status(self.recipient) + print(self.get_task_type()) def create(taskDict):