def post(self, id): params = self.params(['include_entities']) token = md.get_default_access_token() if not token: self.write(json.dumps({ 'success':False, 'info':'No access token avaliable.', })) return td = Twitdao(token) message = td.direct_messages_destroy(id=id, **params) if 'error' in message: self.write(json.dumps({ 'success':False, 'info':message['error'], })) else: self.write(json.dumps({ 'success':True, 'info':'OK', 'message':message, }))
def post(self, id): params = self.params(["include_entities"]) token = md.get_default_access_token() if not token: self.redirect("/settings") return td = Twitdao(token) message = td.direct_messages_destroy(id=id, **params) self.redirect("/a/messages_sent")