Пример #1
0
 def update(self, status=None, in_reply_to=None):
     count = Statuses.all().count()
     if not status:
         status = random.choice(Statuses.all().fetch(1000)).status
     url = "http://twitter.com/statuses/update.json"
     data = urllib.urlencode({"status": status.encode("utf-8"), "in_reply_to_status_id": in_reply_to})
     result = urlfetch.fetch(url=url, method=urlfetch.POST, payload=data, headers=self.auth_header)
     logging.debug(result.status_code)
     logging.debug(result.content)
Пример #2
0
 def update(self, status = None, in_reply_to = None):
     count = Statuses.all().count()
     if not status:
         status = random.choice(Statuses.all().fetch(1000)).status
     url  = 'http://api.twitter.com/1/statuses/update.json'
     data = {
         'status' : status.encode('utf-8'),
         'in_reply_to_status_id' : in_reply_to,
         }
     result = self.client.make_request(
         url,
         token   = self.bot_config['access_token'],
         secret  = self.bot_config['access_token_secret'],
         additional_params = data,
         protected         = True,
         method            = urlfetch.POST)
     logging.debug(result.status_code)
     logging.debug(result.content)