Statuses/comments by me

跳转到: 导航, 搜索
(请求参数)
 
(未显示3个用户的16个中间版本)
第1行: 第1行:
==statuses/comments_by_me==
+
{{api_desc2|
发出的评论
+
uri=statuses/comments_by_me|
 
+
desc=获取当前用户发出的评论|
===URL===
+
format=XML/JSON|
http://api.t.sina.com.cn/statuses/comments_by_me.format
+
httpMethod=GET|
+
needAuth=true|
===格式===
+
rateLimit=true|
xml, json
+
params={{api_args|since_id|false|int64|若指定此参数,则只返回ID比since_id大的评论(比since_id发表时间晚)。}}
+
{{api_args|max_id|false|int64|若指定此参数,则返回ID小于或等于max_id的评论}}
===HTTP请求方式===
+
{{api_args|count|false|int,默认值20,最大值200。|单页返回的记录条数。}}
GET
+
{{api_args|page|false|int,默认值1。|返回结果的页码。}}|
+
getParam=&count=5&page=2|
===是否需要登录===
+
postParam=|
true
+
result=
+
===XML示例===
===请求数限制===
+
<pre>
true
+
<comments>
+
===请求参数===
+
* since_id:可选参数(评论ID). 只返回比since_id大(比since_id时间晚的)的评论 
+
:o 示例: http://api.t.sina.com.cn/statuses/user_timeline.xml?since_id=12345
+
* max_id: 可选参数(评论ID).  返回ID不大于max_id的评论。
+
:o 示例: Example: http://api.t.sina.com.cn/statuses/user_timeline.xml?max_id=54321
+
* count:  可选参数.  每次返回的最大记录数,最多返回200条。 
+
:o 示例: http://api.t.sina.com.cn/statuses/user_timeline.xml?count=200
+
* page: 可选参数. 分页返回。注意:最多返回200条分页内容。
+
:o 示例: http://api.t.sina.com.cn/statuses/user_timeline.xml?page=1
+
 
+
===返回结果===
+
XML示例:
+
<?xml version="1.0" encoding="UTF-8"?>
+
<comments>
+
 
   <comment>
 
   <comment>
     <created_at>Tue Dec 15 15:12:51 +0800 2009</created_at>
+
     <created_at>Thu Nov 11 23:11:28 +0800 2010</created_at>
     <id>77236</id>
+
     <id>4439022969</id>
     <text>支持API</text>
+
     <text>世界上最快的人~~~ They are just Genies~~</text>
 
     <user>
 
     <user>
       <id>1502</id>
+
       <id>1658122963</id>
       <screen_name>1502</screen_name>
+
       <screen_name>zhangwei217245</screen_name>
       <name>1502</name>
+
       <name>zhangwei217245</name>
       <province>广东</province>
+
       <province>11</province>
       <city>广州</city>
+
       <city>5</city>
       <location>广东 广州</location>
+
       <location>北京 朝阳区</location>
       <description>blog: timyang.net</description>
+
       <description>ABCDE</description>
       <profile_image_url>http://portrait.sinaimg.cn/1502/50#.jpg</profile_image_url>
+
      <url/>
       <gender></gender>
+
       <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
       <email></email>
+
       <domain>zhangwei217245</domain>
      <qq></qq>
+
       <gender>m</gender>
      <msn></msn>
+
       <followers_count>22</followers_count>
       <followers_count>0</followers_count>
+
       <friends_count>43</friends_count>
       <friends_count>0</friends_count>
+
 
       <statuses_count>0</statuses_count>
 
       <statuses_count>0</statuses_count>
 
       <favourites_count>0</favourites_count>
 
       <favourites_count>0</favourites_count>
       <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
+
       <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
 
       <following>false</following>
 
       <following>false</following>
 
       <verified>false</verified>
 
       <verified>false</verified>
       <profile_background_image_url></profile_background_image_url>
+
       <allow_all_act_msg>false</allow_all_act_msg>
       <url></url>
+
       <geo_enabled>true</geo_enabled>
       <protected>false</protected>
+
       <status>
      <profile_background_color>9ae4e8</profile_background_color>
+
        <created_at>Wed Dec 01 12:46:20 +0800 2010</created_at>
      <profile_text_color>000000</profile_text_color>
+
        <id>3995822273</id>
      <profile_link_color>0000ff</profile_link_color>
+
        <text>Twitter的API文档页面竟然有BUG。。。那个可以收缩的API列表。。。无语。</text>
      <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color>
+
        <source>
      <profile_sidebar_border_color>87bc44</profile_sidebar_border_color>
+
          <a href="">微博开放平台接口</a>
      <utc_offset>28800</utc_offset>
+
        </source>
      <time_zone>CST</time_zone>
+
        <favorited>false</favorited>
      <profile_background_tile>false</profile_background_tile>
+
        <truncated>false</truncated>
      <notifications>false</notifications>
+
        <geo/>
       <geo_enabled>false</geo_enabled>
+
        <in_reply_to_status_id/>
 +
        <in_reply_to_user_id/>
 +
        <in_reply_to_screen_name/>
 +
       </status>
 
     </user>
 
     </user>
 
     <status>
 
     <status>
       <created_at>Tue Dec 15 15:18:51 +0800 2009</created_at>
+
       <created_at>Thu Nov 11 23:10:49 +0800 2010</created_at>
       <id>77234</id>
+
       <id>3583883787</id>
       <text>我们不是“居安思危”,而是“居危思进”。</text>
+
       <text>http://sinaurl.cn/7yJgU</text>
 
       <source>
 
       <source>
         <a href="http://t.sina.com.cn">Web</a>
+
         <a href="http://t.sina.com.cn">新浪微博</a>
 
       </source>
 
       </source>
 
       <favorited>false</favorited>
 
       <favorited>false</favorited>
 
       <truncated>false</truncated>
 
       <truncated>false</truncated>
 
       <geo/>
 
       <geo/>
       <in_reply_to_status_id></in_reply_to_status_id>
+
       <in_reply_to_status_id/>
       <in_reply_to_user_id></in_reply_to_user_id>
+
       <in_reply_to_user_id/>
       <in_reply_to_screen_name></in_reply_to_screen_name>
+
       <in_reply_to_screen_name/>
      <thumbnail_pic>http://static16.photo.sina.com.cn/thumbnail/62988d06tcbbc377f7bbf</thumbnail_pic>
+
      <bmiddle_pic>http://static16.photo.sina.com.cn/bmiddle/62988d06tcbbc377f7bbf</bmiddle_pic>
+
      <original_pic>http://static16.photo.sina.com.cn/orignal/62988d06tcbbc377f7bbf</original_pic>
+
 
       <user>
 
       <user>
         <id>47147</id>
+
         <id>1658122963</id>
         <screen_name>47147</screen_name>
+
         <screen_name>zhangwei217245</screen_name>
         <name>47147</name>
+
         <name>zhangwei217245</name>
         <province>广东</province>
+
         <province>11</province>
         <city>广州</city>
+
         <city>5</city>
         <location>广东 广州</location>
+
         <location>北京 朝阳区</location>
         <description>blog: timyang.net</description>
+
         <description>ABCDE</description>
         <profile_image_url>http://portrait.sinaimg.cn/47147/50#.jpg</profile_image_url>
+
        <url/>
         <gender></gender>
+
         <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
         <email></email>
+
         <domain>zhangwei217245</domain>
        <qq></qq>
+
         <gender>m</gender>
        <msn></msn>
+
         <followers_count>22</followers_count>
         <followers_count>0</followers_count>
+
         <friends_count>43</friends_count>
         <friends_count>0</friends_count>
+
 
         <statuses_count>0</statuses_count>
 
         <statuses_count>0</statuses_count>
 
         <favourites_count>0</favourites_count>
 
         <favourites_count>0</favourites_count>
         <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
+
         <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
 
         <following>false</following>
 
         <following>false</following>
 
         <verified>false</verified>
 
         <verified>false</verified>
         <profile_background_image_url></profile_background_image_url>
+
         <allow_all_act_msg>false</allow_all_act_msg>
        <url></url>
+
         <geo_enabled>true</geo_enabled>
        <protected>false</protected>
+
        <profile_background_color>9ae4e8</profile_background_color>
+
        <profile_text_color>000000</profile_text_color>
+
        <profile_link_color>0000ff</profile_link_color>
+
        <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color>
+
        <profile_sidebar_border_color>87bc44</profile_sidebar_border_color>
+
        <utc_offset>28800</utc_offset>
+
        <time_zone>CST</time_zone>
+
        <profile_background_tile>false</profile_background_tile>
+
        <notifications>false</notifications>
+
         <geo_enabled>false</geo_enabled>
+
 
       </user>
 
       </user>
 
     </status>
 
     </status>
    <reply_comment>
 
      <created_at>Tue Dec 15 15:12:51 +0800 2009</created_at>
 
      <id>77235</id>
 
      <text>API真好</text>
 
      <user>
 
        <id>58597</id>
 
        <screen_name>58597</screen_name>
 
        <name>58597</name>
 
        <province>广东</province>
 
        <city>广州</city>
 
        <location>广东 广州</location>
 
        <description>blog: timyang.net</description>
 
        <profile_image_url>http://portrait.sinaimg.cn/58597/50#.jpg</profile_image_url>
 
        <gender></gender>
 
        <email></email>
 
        <qq></qq>
 
        <msn></msn>
 
        <followers_count>0</followers_count>
 
        <friends_count>0</friends_count>
 
        <statuses_count>0</statuses_count>
 
        <favourites_count>0</favourites_count>
 
        <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
 
        <following>false</following>
 
        <verified>false</verified>
 
        <profile_background_image_url></profile_background_image_url>
 
        <url></url>
 
        <protected>false</protected>
 
        <profile_background_color>9ae4e8</profile_background_color>
 
        <profile_text_color>000000</profile_text_color>
 
        <profile_link_color>0000ff</profile_link_color>
 
        <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color>
 
        <profile_sidebar_border_color>87bc44</profile_sidebar_border_color>
 
        <utc_offset>28800</utc_offset>
 
        <time_zone>CST</time_zone>
 
        <profile_background_tile>false</profile_background_tile>
 
        <notifications>false</notifications>
 
        <geo_enabled>false</geo_enabled>
 
      </user>
 
    </reply_comment>
 
 
   </comment>
 
   </comment>
... truncated ...
+
...
</comments>
+
</comments>
 
+
</pre>
JSON示例:
+
===JSON示例===
 
+
<pre>
[
+
[
  {"created_at":"Wed Jan 06 14:41:02 +0800 2010",
+
    {
    "id":142257,
+
        "id" : 4439022969,
    "text":"ssss",
+
        "text" : "世界上最快的人~~~ They are just Genies~~",
    "source":"<a id=\"0\" href=\"http://t.sina.com.cn/\" rel=\"nofollow\">Web</a>",
+
        "created_at" : "Thu Nov 11 23:11:28 +0800 2010",
    "favorited":false,
+
        "user" :  
    "truncated":false,
+
        {
    "in_reply_to_status_id":"",
+
            "name" : "zhangwei217245",
    "in_reply_to_user_id":"",
+
            "domain" : "zhangwei217245",
    "in_reply_to_screen_name":"",
+
            "geo_enabled" : true,
    "thumbnail_pic":"http://static12.photo.sina.com.cn/thumbnail/5219ba9d072d8ec7c2a3b",
+
            "followers_count" : 22,
    "bmiddle_pic":"http://static12.photo.sina.com.cn/bmiddle/5219ba9d072d8ec7c2a3b",
+
            "statuses_count" : 0,
    "original_pic":"http://static12.photo.sina.com.cn/orignal/5219ba9d072d8ec7c2a3b",
+
            "favourites_count" : 0,
    "geo":null,
+
            "city" : "5",
    "user":
+
            "description" : "ABCDE",
        {"id":11075,
+
            "verified" : false,
        "screen_name":"name_11075",
+
            "status" :
        "name":"name_11075",
+
            {
        "province":null,
+
                "created_at" : "Wed Dec 01 12:46:20 +0800 2010",
        "city":null,
+
                "text" : "Twitter的API文档页面竟然有BUG。。。那个可以收缩的API列表。。。无语。",
        "location":"",
+
                "truncated" : false,
        "description":"",
+
                "in_reply_to_status_id" : "",
        "profile_image_url":"http://tp4.sinaimg.cn/11075/50/0",
+
                "in_reply_to_screen_name" : "",
        "domain":"11075",
+
                "geo" : null,
        "email":"",
+
                "favorited" : false,
        "qq":"4102",
+
                "in_reply_to_user_id" : "",
        "msn":"msn_4102",
+
                "id" : 3995822273,
        "followers_count":28,
+
                "source" : "<a href=\"\" rel=\"nofollow\">微博开放平台接口</a>"
        "friends_count":50,
+
            },
        "statuses_count":0,
+
            "id" : 1658122963,
        "favourites_count":11,
+
            "gender" : "m",
        "created_at":"Thu Jan 01 08:00:00 +0800 1970",
+
            "friends_count" : 43,
        "following":false,
+
            "screen_name" : "zhangwei217245",
        "geo_enabled":false,
+
            "allow_all_act_msg" : false,
        "verified":true},
+
            "following" : false,
    "apiState":3},
+
            "url" : "",
     {},
+
            "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
    ...
+
            "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
]
+
            "province" : "11",
 
+
            "location" : "北京 朝阳区"
===使用示例===
+
        },
 
+
        "status" :
* xml:
+
        {
curl -u user:password http://api.t.sina.com.cn/statuses/comments_by_me.xml
+
            "created_at" : "Thu Nov 11 23:10:49 +0800 2010",
 
+
            "text" : "http://sinaurl.cn/7yJgU",
* json:
+
            "truncated" : false,
curl -u user:password http://api.t.sina.com.cn/statuses/comments_by_me.json
+
            "in_reply_to_status_id" : "",
 +
            "in_reply_to_screen_name" : "",
 +
            "geo" : null,
 +
            "user" :  
 +
            {
 +
                "name" : "zhangwei217245",
 +
                "domain" : "zhangwei217245",
 +
                "geo_enabled" : true,
 +
                "followers_count" : 22,
 +
                "statuses_count" : 0,
 +
                "favourites_count" : 0,
 +
                "city" : "5",
 +
                "description" : "ABCDE",
 +
                "verified" : false,
 +
                "id" : 1658122963,
 +
                "gender" : "m",
 +
                "friends_count" : 43,
 +
                "screen_name" : "zhangwei217245",
 +
                "allow_all_act_msg" : false,
 +
                "following" : false,
 +
                "url" : "",
 +
                "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
 +
                "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
 +
                "province" : "11",
 +
                "location" : "北京 朝阳区"
 +
            },
 +
            "favorited" : false,
 +
            "in_reply_to_user_id" : "",
 +
            "id" : 3583883787,
 +
            "source" : "<a href=\"http://t.sina.com.cn\" rel=\"nofollow\">新浪微博</a>"
 +
        }
 +
     },
 +
...
 +
]
 +
</pre>
 +
{{Param_comment}}
 +
{{Param_user}}
 +
{{Param_status}}|
 +
useAge=无|
 +
otherInfo=
 +
===Java示例===
 +
请从 [[SDK | 微博SDK开发包下载]] 下载Java SDK<br>
 +
代码示意如下:
 +
<pre>
 +
public class GetCommentsByMe {
 +
 +
/**
 +
* 获取当前用户发表的评论列表
 +
* @param args
 +
*/
 +
public static void main(String[] args) {
 +
    System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
 +
        System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
 +
            try {
 +
        Weibo weibo = getWeibo(true,args);
 +
        List<Comment> comments = weibo.getCommentsByMe();
 +
for (Comment comment: comments){
 +
    System.out.println(comment.getId()+":"+comment.getText()+" by "+comment.getUser().getScreenName());
 +
}
 +
    } catch (Exception e) {
 +
e.printStackTrace();
 +
            }
 +
}
 +
 +
private static Weibo getWeibo(boolean isOauth,String ... args) {
 +
Weibo weibo = new Weibo();
 +
if(isOauth) {//oauth验证方式 args[0]:访问的token;args[1]:访问的密匙
 +
weibo.setToken(args[0], args[1]);
 +
}else {//用户登录方式
 +
    weibo.setUserId(args[0]);//用户名/ID
 +
    weibo.setPassword(args[1]);//密码
 +
}
 +
return weibo;
 +
}
 +
}
 +
</pre>
 +
===PHP示例===
 +
请从 [[SDK | 微博SDK开发包下载]] 处下载PHP SDK(支持OAuth验证之版本)<br>
 +
代码示例如下:
 +
<pre>
 +
//statuses/comments_by_me
 +
$c = new WeiboClient( WB_AKEY ,
 +
                      WB_SKEY ,
 +
                      $_SESSION['last_key']['oauth_token'] ,
 +
                      $_SESSION['last_key']['oauth_token_secret']  );
 +
$msg  = $c->comments_by_me();
 +
if ($msg === false || $msg === null){
 +
echo "Error occured";
 +
return false;
 +
}
 +
if (isset($msg['error_code']) && isset($msg['error'])){
 +
echo ('Error_code: '.$msg['error_code'].';  Error: '.$msg['error'] );
 +
return false;
 +
}
 +
foreach ($msg as $data){
 +
$user_name = $data['user']['name'];
 +
$text = $data['text'];
 +
echo $user_name."=".$text.";";
 +
}
 +
</pre>
 +
}}

2010年12月1日 (三) 15:18的最后版本

目录

statuses/comments_by_me

获取当前用户发出的评论

URL

http://api.t.sina.com.cn/statuses/comments_by_me.(json%7Cxml)

支持格式

XML/JSON

HTTP请求方式

GET

是否需要登录

true
关于授权机制,参见授权机制声明

请求数限制

true
关于请求数限制,参见接口访问权限说明

请求参数

  必选 类型及范围 说明
source true string 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数)
since_id false int64 若指定此参数,则只返回ID比since_id大的评论(比since_id发表时间晚)。
max_id false int64 若指定此参数,则返回ID小于或等于max_id的评论
count false int,默认值20,最大值200。 单页返回的记录条数。
page false int,默认值1。 返回结果的页码。

注意事项

返回结果

XML示例

<comments>
  <comment>
    <created_at>Thu Nov 11 23:11:28 +0800 2010</created_at>
    <id>4439022969</id>
    <text>世界上最快的人~~~ They are just Genies~~</text>
    <user>
      <id>1658122963</id>
      <screen_name>zhangwei217245</screen_name>
      <name>zhangwei217245</name>
      <province>11</province>
      <city>5</city>
      <location>北京 朝阳区</location>
      <description>ABCDE</description>
      <url/>
      <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
      <domain>zhangwei217245</domain>
      <gender>m</gender>
      <followers_count>22</followers_count>
      <friends_count>43</friends_count>
      <statuses_count>0</statuses_count>
      <favourites_count>0</favourites_count>
      <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
      <following>false</following>
      <verified>false</verified>
      <allow_all_act_msg>false</allow_all_act_msg>
      <geo_enabled>true</geo_enabled>
      <status>
        <created_at>Wed Dec 01 12:46:20 +0800 2010</created_at>
        <id>3995822273</id>
        <text>Twitter的API文档页面竟然有BUG。。。那个可以收缩的API列表。。。无语。</text>
        <source>
          <a href="">微博开放平台接口</a>
        </source>
        <favorited>false</favorited>
        <truncated>false</truncated>
        <geo/>
        <in_reply_to_status_id/>
        <in_reply_to_user_id/>
        <in_reply_to_screen_name/>
      </status>
    </user>
    <status>
      <created_at>Thu Nov 11 23:10:49 +0800 2010</created_at>
      <id>3583883787</id>
      <text>http://sinaurl.cn/7yJgU</text>
      <source>
        <a href="http://t.sina.com.cn">新浪微博</a>
      </source>
      <favorited>false</favorited>
      <truncated>false</truncated>
      <geo/>
      <in_reply_to_status_id/>
      <in_reply_to_user_id/>
      <in_reply_to_screen_name/>
      <user>
        <id>1658122963</id>
        <screen_name>zhangwei217245</screen_name>
        <name>zhangwei217245</name>
        <province>11</province>
        <city>5</city>
        <location>北京 朝阳区</location>
        <description>ABCDE</description>
        <url/>
        <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
        <domain>zhangwei217245</domain>
        <gender>m</gender>
        <followers_count>22</followers_count>
        <friends_count>43</friends_count>
        <statuses_count>0</statuses_count>
        <favourites_count>0</favourites_count>
        <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
        <following>false</following>
        <verified>false</verified>
        <allow_all_act_msg>false</allow_all_act_msg>
        <geo_enabled>true</geo_enabled>
      </user>
    </status>
  </comment>
...
</comments>

JSON示例

[
    {
        "id" : 4439022969,
        "text" : "世界上最快的人~~~ They are just Genies~~",
        "created_at" : "Thu Nov 11 23:11:28 +0800 2010",
        "user" : 
        {
            "name" : "zhangwei217245",
            "domain" : "zhangwei217245",
            "geo_enabled" : true,
            "followers_count" : 22,
            "statuses_count" : 0,
            "favourites_count" : 0,
            "city" : "5",
            "description" : "ABCDE",
            "verified" : false,
            "status" : 
            {
                "created_at" : "Wed Dec 01 12:46:20 +0800 2010",
                "text" : "Twitter的API文档页面竟然有BUG。。。那个可以收缩的API列表。。。无语。",
                "truncated" : false,
                "in_reply_to_status_id" : "",
                "in_reply_to_screen_name" : "",
                "geo" : null,
                "favorited" : false,
                "in_reply_to_user_id" : "",
                "id" : 3995822273,
                "source" : "<a href=\"\" rel=\"nofollow\">微博开放平台接口</a>"
            },
            "id" : 1658122963,
            "gender" : "m",
            "friends_count" : 43,
            "screen_name" : "zhangwei217245",
            "allow_all_act_msg" : false,
            "following" : false,
            "url" : "",
            "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
            "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
            "province" : "11",
            "location" : "北京 朝阳区"
        },
        "status" : 
        {
            "created_at" : "Thu Nov 11 23:10:49 +0800 2010",
            "text" : "http://sinaurl.cn/7yJgU",
            "truncated" : false,
            "in_reply_to_status_id" : "",
            "in_reply_to_screen_name" : "",
            "geo" : null,
            "user" : 
            {
                "name" : "zhangwei217245",
                "domain" : "zhangwei217245",
                "geo_enabled" : true,
                "followers_count" : 22,
                "statuses_count" : 0,
                "favourites_count" : 0,
                "city" : "5",
                "description" : "ABCDE",
                "verified" : false,
                "id" : 1658122963,
                "gender" : "m",
                "friends_count" : 43,
                "screen_name" : "zhangwei217245",
                "allow_all_act_msg" : false,
                "following" : false,
                "url" : "",
                "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
                "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
                "province" : "11",
                "location" : "北京 朝阳区"
            },
            "favorited" : false,
            "in_reply_to_user_id" : "",
            "id" : 3583883787,
            "source" : "<a href=\"http://t.sina.com.cn\" rel=\"nofollow\">新浪微博</a>"
        }
    },
...
]

字段说明 - comment

  • id: 评论ID
  • text: 评论内容
  • source: 评论来源
  • favorited: 是否收藏
  • truncated: 是否被截断
  • created_at: 评论时间
  • user: 评论人信息,结构参考user
  • status: 评论的微博,结构参考status
  • reply_comment 评论来源,数据结构跟comment一致

字段说明 - user

  • id: 用户UID
  • screen_name: 微博昵称
  • name: 友好显示名称,同微博昵称
  • province: 省份编码(参考省份编码表)
  • city: 城市编码(参考城市编码表)
  • location:地址
  • description: 个人描述
  • url: 用户博客地址
  • profile_image_url: 自定义图像
  • domain: 用户个性化URL
  • gender: 性别,m--男,f--女,n--未知
  • followers_count: 粉丝数
  • friends_count: 关注数
  • statuses_count: 微博数
  • favourites_count: 收藏数
  • created_at: 创建时间
  • following: 是否已关注(此特性暂不支持)
  • verified: 加V标示,是否微博认证用户

字段说明 - status

  • created_at: 创建时间
  • id: 微博ID
  • text: 微博信息内容
  • source: 微博来源
  • favorited: 是否已收藏
  • truncated: 是否被截断
  • in_reply_to_status_id: 回复ID
  • in_reply_to_user_id: 回复人UID
  • in_reply_to_screen_name: 回复人昵称
  • thumbnail_pic: 缩略图
  • bmiddle_pic: 中型图片
  • original_pic:原始图片
  • user: 作者信息
  • retweeted_status: 转发的博文,内容为status,如果不是转发,则没有此字段

其他

Java示例

请从 微博SDK开发包下载 下载Java SDK
代码示意如下:

 public class GetCommentsByMe {
 
 	/**
 	 * 获取当前用户发表的评论列表 
 	 * @param args
 	 */
 	public static void main(String[] args) {
 	    System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
     	    System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
            try {
         	Weibo weibo = getWeibo(true,args);
         	List<Comment> comments = weibo.getCommentsByMe();
		for (Comment comment: comments){
		    System.out.println(comment.getId()+":"+comment.getText()+" by "+comment.getUser().getScreenName());
		}
 	    } catch (Exception e) {
 			e.printStackTrace();
            }
 	}
 
 	private static Weibo getWeibo(boolean isOauth,String ... args) {
 		Weibo weibo = new Weibo();
 		if(isOauth) {//oauth验证方式 args[0]:访问的token;args[1]:访问的密匙
 			weibo.setToken(args[0], args[1]);
 		}else {//用户登录方式
     		weibo.setUserId(args[0]);//用户名/ID
    		weibo.setPassword(args[1]);//密码
 		}
 		return weibo;
 	}
 }

PHP示例

请从 微博SDK开发包下载 处下载PHP SDK(支持OAuth验证之版本)
代码示例如下:

//statuses/comments_by_me
$c = new WeiboClient( WB_AKEY , 
                      WB_SKEY , 
                      $_SESSION['last_key']['oauth_token'] , 
                      $_SESSION['last_key']['oauth_token_secret']  );
$msg  = $c->comments_by_me();
if ($msg === false || $msg === null){
	echo "Error occured";
	return false;
}
if (isset($msg['error_code']) && isset($msg['error'])){
	echo ('Error_code: '.$msg['error_code'].';  Error: '.$msg['error'] );
	return false;
}
foreach ($msg as $data){
	$user_name = $data['user']['name'];
	$text = $data['text'];
	echo $user_name."=".$text.";";
}
文档更新时间: 2010-12-01