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


Python API.upload_result方法代码示例

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


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

示例1: SinaAPI

# 需要导入模块: from api import API [as 别名]
# 或者: from api.API import upload_result [as 别名]

#.........这里部分代码省略.........
        return src, target

    @check_remain_requests('Too many requests in ifFollowedBy')
    def ifFollowedBy(self, target_id):
        logger.info('api-nail')
        src, target = self.api.show_friendship(target_id=target_id)
        return src.followed_by
    
    @check_remain_requests('Too many requests in comment')
    def comment(self, comment, mid, cid=None):
        logger.info('api-nail')
        status = self.api.comment(id=mid, comment=comment, comment_ori=0)
        ncid = self.getAttValue(status,"id")
        text = self.getAttValue(status,"text")
        return ncid

    @check_remain_requests('Too many requests in comment')
    def reply(self, comment, sid, cid):
        logger.info('api-nail')
        status = self.api.reply(id=sid,cid=cid,comment=comment, without_mention=True)
        ncid = self.getAttValue(status,"id")
        text = self.getAttValue(status,"text")
        return ncid
        
    @check_remain_requests('Too many requests in commentDestroy')
    def commentDestroy(self, cid):
        status = self.api.comment_destroy(cid)
        ncid = self.getAttValue(status,"id")
        text = self.getAttValue(status,"text")

    @check_remain_requests('Too many requests in uploadResult')
    def uploadResult(self, contents, status,contenttype="image/png"):
        logger.info('api-nail')
        status = self.api.upload_result(contents, status,contenttype=contenttype)
        ncid = self.getAttValue(status, "id")
        text = self.getAttValue(status, "text")
        return status

    @check_remain_requests('Too many requests in upload')
    def upload(self, filename, status):
        logger.info('api-nail')
        status = self.api.upload(filename, status)
        ncid = self.getAttValue(status, "id")
        text = self.getAttValue(status, "text")

    @check_remain_requests('Too many requests in createFriendship')
    def createFriendship(self,user_id):
        logger.info('api-nail')
        user = self.api.create_friendship(user_id=user_id)
        return user

    @check_remain_requests('Too many requests in destoryFriendship')
    def destroyFriendship(self,user_id):
        logger.info('api-nail')
        user = self.api.destroy_friendship(user_id=user_id)
        return user

    def getRateLimit(self):
        logger.info('api-nail')
        return self.api.rate_limit_status()


    @check_remain_requests('Too many requests in destoryFriendship')
    def getTrendsStatus(self, trend, province=0, count=200, page=1):
        status = self.api.trends_statuses(
            trend=trend,
开发者ID:seraphlnWu,项目名称:weibosdk,代码行数:70,代码来源:sinaapi.py


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