本文整理汇总了Python中twitdao.Twitdao.statuses_show方法的典型用法代码示例。如果您正苦于以下问题:Python Twitdao.statuses_show方法的具体用法?Python Twitdao.statuses_show怎么用?Python Twitdao.statuses_show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitdao.Twitdao
的用法示例。
在下文中一共展示了Twitdao.statuses_show方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from twitdao import Twitdao [as 别名]
# 或者: from twitdao.Twitdao import statuses_show [as 别名]
def get(self):
screen_name = self.param("screen_name")
status_id = self.param("status_id")
params = self.params(["trim_user", "include_entities"])
token = md.get_default_access_token()
if not token:
self.redirect("/settings")
return
if screen_name:
td = Twitdao(token)
token_user = td.users_show_by_id(user_id=token.user_id)
owner_user = token_user
self.render(
"reply.html",
{"token": token, "token_user": token_user, "owner_user": owner_user, "screen_name": screen_name},
)
else:
td = Twitdao(token)
token_user = td.users_show_by_id(user_id=token.user_id)
owner_user = token_user
tweet = td.statuses_show(id=status_id, **params)
self.render(
"reply.html", {"token": token, "token_user": token_user, "owner_user": owner_user, "tweet": tweet}
)
示例2: get
# 需要导入模块: from twitdao import Twitdao [as 别名]
# 或者: from twitdao.Twitdao import statuses_show [as 别名]
def get(self, id):
params = self.params(['trim_user','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)
token_user = td.users_show_by_id(user_id = token.user_id)
tweet = td.statuses_show(id=id, **params)
tweet_html = self.render('ajax/user-tweet.html', {
'token':token,
#'token_user':token_user,
'tweet':tweet,
}, out=False)
self.write(json.dumps({
'tweet':tweet_html if 'error' not in tweet else None,
'success':'error' not in tweet,
'info':tweet['error'] if 'error' in tweet else 'OK',
}))
示例3: get
# 需要导入模块: from twitdao import Twitdao [as 别名]
# 或者: from twitdao.Twitdao import statuses_show [as 别名]
def get(self, tweet_id):
params = self.params(["trim_user", "include_entities"])
token = md.get_default_access_token()
if not token:
self.redirect("/settings")
return
id = utils.tweet_id_decode(tweet_id)
td = Twitdao(token)
token_user = td.users_show_by_id(user_id=token.user_id)
owner_user = token_user
tweet = td.statuses_show(id=id, **params)
self.render(
"mobile/unfavorite.html",
{"token": token, "token_user": token_user, "owner_user": owner_user, "tweet": tweet},
)