Weibo/getmyweibo

出自天涯开放平台资源

跳转到: 导航, 搜索

目录

Weibo/getmyweibo

获取我的发布微博列表

URL

http://open.tianya.cn/api/weibo/getmyweibo.php

支持格式

XML/JSON

HTTP请求方式

POST/GET

是否需要登录

true,关于授权机制,参见OAuth相关说明

请求数限制

true,关于请求数限制,参见OAuth相关说明

请求参数

  必选 类型及范围 说明
appkey true string 申请应用时分配的appkey,调用接口时候代表应用的唯一身份
oauth_token true string 授权成功后所获得的 oauth_token
oauth_token_secret true string 授权成功后所获得的oauth_token_secret
timestamp true string 请求时候产生的时间戳time()
tempkey true string strtoupper(md5($timestamp.$appkey.$oauth_token.$oauth_token_secret.$appsecret))
pagesize true int 每页显示条数
page true int 当前页码
outformat false string 可选,返回数据格式,默认为json

注意事项

http://open.tianya.cn/api/weibo/getmyweibo.php
若取当前用信息错误,则返回400错误,提示:"error_code"=>"40002", "error_msg"=>"request data error若取当前用信息错误,则返回400错误,提示: "error_code"=>"40002", "error_msg"=>"request data error"

返回结果

XML示例

<?xml version="1.0" encoding="utf8"?><data><total>71</total><items><item id="0"><sharedUname></sharedUname><sharedStartype>0</sharedStartype><time>1314090012000</time><id>36845804</id><star>0</star><originContent>测试,erer,dff</originContent><sharedMedia></sharedMedia><sharedReplyCount>0</sharedReplyCount><shareCount>0</shareCount><url></url><sharedStarurl></sharedStarurl><body></body><sharedId>0</sharedId><startype>0</startype><medias></medias><sharedStar>0</sharedStar><word>测试,erer,dff</word><sharedTitle></sharedTitle><uid>51006851</uid><media></media><from>来自天涯开放平台</from><uname>yiercn</uname><stardesc></stardesc><sharedUid>0</sharedUid><sharedShareCount>0</sharedShareCount><starurl></starurl><replyCount>0</replyCount><sharedMedias></sharedMedias><sharedStardesc></sharedStardesc></item><item id="1"><sharedUname></sharedUname><sharedStartype>0</sharedStartype><time>1314089806000</time><id>36845611</id><star>0</star><originContent>测试,erer,dff</originContent><sharedMedia></sharedMedia><sharedReplyCount>0</sharedReplyCount><shareCount>0</shareCount><url></url><sharedStarurl></sharedStarurl><body></body><sharedId>0</sharedId><startype>0</startype><medias></medias><sharedStar>0</sharedStar><word>测试,erer,dff</word><sharedTitle></sharedTitle><uid>51006851</uid><media></media><from>来自天涯开放平台</from><uname>yiercn</uname><stardesc></stardesc><sharedUid>0</sharedUid><sharedShareCount>0</sharedShareCount><starurl></starurl><replyCount>0</replyCount><sharedMedias></sharedMedias><sharedStardesc></sharedStardesc></item></items><time>1314606602075</time></data><result>1</result><error></error>

JSON示例

 {"data":{"total":71,"items":[{"sharedUname":"","sharedStartype":0,"time":1314090012000,"id":36845804,"star":0,"originContent":"测试,erer,dff","sharedMedia":"","sharedReplyCount":0,"shareCount":0,"url":"","sharedStarurl":"","body":"","sharedId":0,"startype":0,"medias":{},"sharedStar":0,"word":"测试,erer,dff","sharedTitle":"","uid":51006851,"media":"","from":"来自天涯开放平台","uname":"yiercn","stardesc":"","sharedUid":0,"sharedShareCount":0,"starurl":"","replyCount":0,"sharedMedias":{},"sharedStardesc":""},{"sharedUname":"","sharedStartype":0,"time":1314089806000,"id":36845611,"star":0,"originContent":"测试,erer,dff","sharedMedia":"","sharedReplyCount":0,"shareCount":0,"url":"","sharedStarurl":"","body":"","sharedId":0,"startype":0,"medias":{},"sharedStar":0,"word":"测试,erer,dff","sharedTitle":"","uid":51006851,"media":"","from":"来自天涯开放平台","uname":"yiercn","stardesc":"","sharedUid":0,"sharedShareCount":0,"starurl":"","replyCount":0,"sharedMedias":{},"sharedStardesc":""}],"time":1314606565872},"result":1,"error":""}

返回字段说明

 {   
    "result":"",   
    "error":"",   
    "data":{   
        "total":,   
        "items":[   
            {   
                "id":"",   
                "word":"我刚刚发布的微博",   
                "time":"",   
                "from":"通过网页", //途径 来自论坛,来自博客,来自相册,通过网页,通过短信   
                "shareCount":"",//该微博的转发数   
                "replyCount":"",//该微博的回复数   
                "media":"", //原创时引用的图片   
                "mediaFlag":"",//原创时的多媒体类型   
                   
                "sharedId":"",//被转发的微博id,为时代表原创。   
                "sharedUid":"",//被转发的微博作者id   
                "sharedStar":"",//为牛人,或没有为非牛人   
                "sharedUname":"",//被转发的微博作者name   
                "sharedTitle":"",//被转发的微博标题   
                "sharedMedia":"",//被转发的微博引用的图片   
                "sharedMediaFlag":"",//被转发的微博多媒体类型   
                "sharedShareCount":"",//被转发次数   
                "sharedReplyCount":"" //被回复次数   
            }   
         ]   
    }   
  }   

PHP示例

SDK下载

代码示例如下: 
include 'tyapi.php'; 
//参数设置 
$appkey=; 
$appsecret=;
$param[‘pagesize’]=2;
$param[‘page’]=1;
$url = 'http://open.tianya.cn/api/weibo/getmyweibo.php';
$data = do_post($url,$appkey,$appsecret,$_SESSION["oauth_token"],$_SESSION["oauth_token_secret"],$param);
查看
个人工具
成功案例
帮助中心