当前位置: 首页>>代码示例>>Python>>正文


Python Twitdao.users_show_by_id方法代码示例

本文整理汇总了Python中twitdao.Twitdao.users_show_by_id方法的典型用法代码示例。如果您正苦于以下问题:Python Twitdao.users_show_by_id方法的具体用法?Python Twitdao.users_show_by_id怎么用?Python Twitdao.users_show_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twitdao.Twitdao的用法示例。


在下文中一共展示了Twitdao.users_show_by_id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from twitdao import Twitdao [as 别名]
# 或者: from twitdao.Twitdao import users_show_by_id [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}
            )
开发者ID:tongsu,项目名称:twitdao,代码行数:32,代码来源:main.py

示例2: get

# 需要导入模块: from twitdao import Twitdao [as 别名]
# 或者: from twitdao.Twitdao import users_show_by_id [as 别名]
    def get(self):
        user_id = self.param('user_id')

        token = md.get_default_access_token()
        if not token:
            self.write(json.dumps({
                'success':False,
                'info':'Token error.'
            }))
            return

        td = Twitdao(token)
        token_user = td.users_show_by_id(user_id = token.user_id)
        owner_user = token_user

        res=td.hacked_follows_in_common_with(user_id)
        tweets=self.render('ajax/follows_in_common_with.html', {
            'token':token,
            'token_user':token_user,
            'owner_user':owner_user,
            'res':res,
        },out=False)

        self.write(json.dumps({
            'success':True,
            'info':'OK',
            'html':tweets,
        }))
开发者ID:messiahxu,项目名称:Twitdao11,代码行数:30,代码来源:ajax.py

示例3: get

# 需要导入模块: from twitdao import Twitdao [as 别名]
# 或者: from twitdao.Twitdao import users_show_by_id [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',
        }))
开发者ID:messiahxu,项目名称:Twitdao11,代码行数:27,代码来源:ajax1.py

示例4: get

# 需要导入模块: from twitdao import Twitdao [as 别名]
# 或者: from twitdao.Twitdao import users_show_by_id [as 别名]
 def get(self):
     token = md.get_default_access_token()
     if not token:
         self.redirect("/settings")
         return
     td = Twitdao(token)
     token_user = td.users_show_by_id(user_id=token.user_id)
     owner_user = token_user
     self.render("mobile/upload.html", {"token": token, "token_user": token_user, "owner_user": owner_user})
开发者ID:tongsu,项目名称:twitdao,代码行数:11,代码来源:mobile.py

示例5: post

# 需要导入模块: from twitdao import Twitdao [as 别名]
# 或者: from twitdao.Twitdao import users_show_by_id [as 别名]
    def post(self):
        name = self.param("name")
        params = self.params(["mode", "description"], mode="public")

        name = name.encode("utf-8")
        if "description" in params:
            params["description"] = params["description"].encode("utf-8")

        token = md.get_default_access_token()
        if not token:
            self.redirect("/settings")
            return

        td = Twitdao(token)
        token_user = td.users_show_by_id(user_id=token.user_id)
        lst = td.user_lists_post(name=name, **params)
        self.redirect("/t/%s/%s" % (token_user["screen_name"], urllib.quote(lst["slug"].encode("utf-8"))))
开发者ID:tongsu,项目名称:twitdao,代码行数:19,代码来源:main.py


注:本文中的twitdao.Twitdao.users_show_by_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。