Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 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
Beispiel #4
0
 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
Beispiel #5
0
 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
Beispiel #6
0
 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
Beispiel #7
0
 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
Beispiel #8
0
 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
Beispiel #9
0
 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