def tweet(self,tweet,replyid=None): params = {"status":tweet} if len(tweet) > 140: return False if id: params['in_reply_to_status_id'] = replyid try: result = api.api('https://api.twitter.com/1.1/statuses/update.json',self.token, params,http_method='POST') except e: print e else: self.sendJS.emit("onTweetSuccess();") print "Connector tweet:", tweet, replyid, result
def delete_dm(self,id): result = api.api('http://api.twitter.com/1.1/direct_messages/destroy/%s.json' % id, self.token, http_method='POST') print "Connector delete dm:", id, result
def delete_tweet(self,id): result = api.api('https://api.twitter.com/1.1/statuses/destroy/%s.json' % id, self.token, http_method='POST') print "Connector delete tweet:", id, result
def spam(self,screen_name): result = api.api('https://api.twitter.com/1.1/report_spam.json', self.token, {"screen_name":screen_name}, http_method='POST') print "Connector spam:", screen_name, result
def block(self,screen_name): result = api.api('http://api.twitter.com/1.1/blocks/create.json', self.token, {"screen_name":screen_name}, http_method='POST') print "Connector block:", screen_name, result
def unfollow(self,screen_name): result = api.api('https://api.twitter.com/1.1/friendships/destroy.json', self.token, {"screen_name":screen_name}, http_method='POST') print "Connector unfollow:", screen_name, result
def unfave(self,id): result = api.api('https://api.twitter.com/1.1/favorites/destroy/%s.json' % id, self.token, http_method='POST') print "Connector unfave:", id, result
def fave(self,str): result = api.api('https://api.twitter.com/1.1/favorites/create/%s.json' % id, self.token, http_method='POST') print "Connector fave:", id, result
def dm(self,screen_name,text): result = api.api('http://api.twitter.com/1.1/direct_messages/new.json', self.token, {"text":text,"screen_name":screen_name},http_method='POST') print "Connector DM:", screen_name, text, result