Statuses/comment destroy

跳转到: 导航, 搜索
 
(未显示5个用户的15个中间版本)
第1行: 第1行:
== statuses/comment_destroy ==
+
{{api_desc2|
删除评论。注意:只能删除自己发布的评论,发部微博的用户不可以删除其他人的评论。
+
uri=statuses/comment_destroy/:id|
 
+
desc=删除评论。注意:只能删除登录用户自己发布的评论,不可以删除其他人的评论。 |
=== URL===
+
format=XML/JSON|
http://api.t.sina.com.cn/statuses/comment_destroy/id.format
+
httpMethod=POST/DELETE|
 
+
needAuth=true|
=== 格式===
+
rateLimit=true|
xml, json
+
params={{api_args|:id|true|int64|欲删除的评论ID,该参数为一个REST风格参数。}}|
+
getParam=|
=== HTTP请求方式===
+
postParam=-X DELETE|
POST, DELETE
+
result=
+
===XML示例===
=== 是否需要身份验证===
+
<pre>
true
+
<?xml version="1.0" encoding="UTF-8"?>
+
<comment>
=== 请求数限制===
+
   <created_at>Fri Dec 03 10:37:39 +0800 2010</created_at>
false
+
  <id>4977097789</id>
 
+
  <text>回复@zhangwei217245:walala</text>
=== 请求参数===
+
  <user>
* id.  必须参数.  要删除的评论ID.    
+
    <id>1658122963</id>
o Example: http://api.t.sina.com.cn/statuses/comment_destroy/12345.xml
+
    <screen_name>zhangwei217245</screen_name>
 
+
    <name>zhangwei217245</name>
=== 使用说明===
+
    <province>11</province>
* 如果评论不存在,将返回403错误
+
    <city>5</city>
* 如果参数错误,将返回500错误
+
    <location>北京 朝阳区</location>
 
+
    <description>ABCDE</description>
 
+
    <url/>
=== 返回结果 ===
+
    <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
XML示例:
+
    <domain>zhangwei217245</domain>
 
+
    <gender>m</gender>
   <?xml version="1.0" encoding="UTF-8"?>
+
    <followers_count>22</followers_count>
   <comment>
+
    <friends_count>43</friends_count>
     <created_at>Fri Jan 08 11:39:02 +0800 2010</created_at>
+
    <statuses_count>115</statuses_count>
     <id>203092</id>
+
    <favourites_count>3</favourites_count>
     <text>aaaaaaaaaaaaaaaaaaaaaa</text>
+
    <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>
 +
     <created_at>Thu Dec 02 17:14:39 +0800 2010</created_at>
 +
     <id>4023227965</id>
 +
     <text>哇哈哈。随便输了个经纬度,就跑到海里去发微博了</text>
 
     <source>
 
     <source>
       <a id="10013" href="http://t.sina.com.cn">SinaDestTop</a>
+
       <a href="http://t.sina.com.cn">新浪微博</a>
 
     </source>
 
     </source>
 +
    <favorited>false</favorited>
 +
    <truncated>false</truncated>
 +
    <geo/>
 +
    <in_reply_to_status_id/>
 +
    <in_reply_to_user_id/>
 +
    <in_reply_to_screen_name/>
 
     <user>
 
     <user>
       <id>11055</id>
+
       <id>1658122963</id>
       <screen_name>name_11055</screen_name>
+
       <screen_name>zhangwei217245</screen_name>
       <name>name_11055</name>
+
       <name>zhangwei217245</name>
       <province>0</province>
+
       <province>11</province>
       <city>0</city>
+
       <city>5</city>
       <location></location>
+
       <location>北京 朝阳区</location>
       <description></description>
+
       <description>ABCDE</description>
       <profile_image_url>http://tp4.sinaimg.cn/11055/50/0</profile_image_url>
+
      <url/>
       <domain>11055</domain>
+
       <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
       <gender></gender>
+
       <domain>zhangwei217245</domain>
      <email></email>
+
       <gender>m</gender>
      <qq>525</qq>
+
       <followers_count>22</followers_count>
      <msn>msn_525</msn>
+
       <friends_count>43</friends_count>
       <followers_count>24</followers_count>
+
       <statuses_count>115</statuses_count>
       <friends_count>51</friends_count>
+
       <favourites_count>3</favourites_count>
       <statuses_count>0</statuses_count>
+
       <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
       <favourites_count>0</favourites_count>
+
       <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
+
 
       <following>false</following>
 
       <following>false</following>
 
       <verified>false</verified>
 
       <verified>false</verified>
       <geo_enabled>false</geo_enabled>
+
       <allow_all_act_msg>false</allow_all_act_msg>
 +
      <geo_enabled>true</geo_enabled>
 
     </user>
 
     </user>
     <status>
+
     <retweeted_status>
       <created_at>Fri Jan 08 10:18:05 +0800 2010</created_at>
+
       <created_at>Thu Dec 02 17:06:40 +0800 2010</created_at>
       <id>142314</id>
+
       <id>4023064087</id>
       <text>lsdjfl55</text>
+
       <text>abc</text>
 
       <source>
 
       <source>
         <a id="10013" href="http://t.sina.com.cn">SinaDestTop</a>
+
         <a href="">微博开放平台接口</a>
 
       </source>
 
       </source>
 
       <favorited>false</favorited>
 
       <favorited>false</favorited>
 
       <truncated>false</truncated>
 
       <truncated>false</truncated>
       <geo/>
+
       <geo xmlns:georss="http://www.georss.org/georss">
      <in_reply_to_status_id></in_reply_to_status_id>
+
        <georss:point>39.8765 119.5678</georss:point>
       <in_reply_to_user_id></in_reply_to_user_id>
+
       </geo>
       <in_reply_to_screen_name></in_reply_to_screen_name>
+
      <in_reply_to_status_id/>
 +
      <in_reply_to_user_id/>
 +
       <in_reply_to_screen_name/>
 +
      <thumbnail_pic>http://ww2.sinaimg.cn/thumbnail/6b85067djw6dbydsnam1xj.jpg</thumbnail_pic>
 +
      <bmiddle_pic>http://ww2.sinaimg.cn/bmiddle/6b85067djw6dbydsnam1xj.jpg</bmiddle_pic>
 +
      <original_pic>http://ww2.sinaimg.cn/large/6b85067djw6dbydsnam1xj.jpg</original_pic>
 
       <user>
 
       <user>
         <id>11075</id>
+
         <id>1803880061</id>
         <screen_name>name_11075</screen_name>
+
         <screen_name>LoopB</screen_name>
         <name>name_11075</name>
+
         <name>LoopB</name>
         <province>0</province>
+
         <province>11</province>
         <city>0</city>
+
         <city>8</city>
         <location></location>
+
         <location>北京 海淀区</location>
         <description></description>
+
         <description/>
         <profile_image_url>http://tp4.sinaimg.cn/11075/50/0</profile_image_url>
+
        <url/>
         <domain>11075</domain>
+
         <profile_image_url>http://tp2.sinaimg.cn/1803880061/50/0/0</profile_image_url>
         <gender></gender>
+
         <domain/>
        <email></email>
+
         <gender>f</gender>
        <qq>4102</qq>
+
         <followers_count>1</followers_count>
        <msn>msn_4102</msn>
+
         <friends_count>1</friends_count>
         <followers_count>28</followers_count>
+
         <statuses_count>21</statuses_count>
         <friends_count>50</friends_count>
+
         <favourites_count>4</favourites_count>
         <statuses_count>0</statuses_count>
+
         <created_at>Fri Aug 27 00:00:00 +0800 2010</created_at>
         <favourites_count>34</favourites_count>
+
         <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
+
 
         <following>false</following>
 
         <following>false</following>
         <verified>true</verified>
+
         <verified>false</verified>
         <geo_enabled>false</geo_enabled>
+
         <allow_all_act_msg>false</allow_all_act_msg>
 +
        <geo_enabled>true</geo_enabled>
 
       </user>
 
       </user>
     </status>
+
     </retweeted_status>
   </comment>
+
    <annotations/>
 +
  </status>
 +
   <reply_comment>
 +
    <created_at>Thu Dec 02 17:25:25 +0800 2010</created_at>
 +
    <id>4949855625</id>
 +
    <text>小新小新。。。我是小浪~~~</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>115</statuses_count>
 +
      <favourites_count>3</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>
 +
  </reply_comment>
 +
</comment>
 +
</pre>
 +
===JSON示例===
 +
<pre>
 +
{
 +
    "id" : 4976882559,
 +
    "text" : "wakaka",
 +
    "created_at" : "Fri Dec 03 10:28:55 +0800 2010",
 +
    "user" :
 +
    {
 +
        "name" : "zhangwei217245",
 +
        "domain" : "zhangwei217245",
 +
        "geo_enabled" : true,
 +
        "followers_count" : 22,
 +
        "statuses_count" : 115,
 +
        "favourites_count" : 3,
 +
        "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" : "北京 朝阳区"
 +
    },
 +
    "status" :
 +
    {
 +
        "created_at" : "Fri Dec 03 09:25:51 +0800 2010",
 +
        "text" : "维基解密新主机被曝位于军事掩体内(图) http://sinaurl.cn/hbqEya",
 +
        "bmiddle_pic" : "http://ww3.sinaimg.cn/bmiddle/63743d1cjw6dbz63h1rfrj.jpg",
 +
        "original_pic" : "http://ww3.sinaimg.cn/large/63743d1cjw6dbz63h1rfrj.jpg",
 +
        "truncated" : false,
 +
        "in_reply_to_status_id" : "",
 +
        "annotations" :
 +
        [
  
 
+
        ],
JSON示例:
+
        "in_reply_to_screen_name" : "",
 
+
        "geo" : null,
  {"created_at":"Fri Jan 08 11:39:30 +0800 2010",
+
        "user" :  
    "id":203093,
+
        {
    "text":"bbbbbbbbbbbb",
+
            "name" : "赵海俊的微薄",
    "source":"<a id=\"10013\" href=\"http://t.sina.com.cn/\" rel=\"nofollow\">SinaDestTop</a>",
+
            "domain" : "",
    "user":
+
            "geo_enabled" : true,
        {"id":11055,
+
            "followers_count" : 315,
          "screen_name":"name_11055",
+
            "statuses_count" : 2984,
          "name":"name_11055",
+
            "favourites_count" : 53,
          "province":"0",
+
            "city" : "5",
          "city":"0",
+
            "description" : "运动健将",
          "location":"",
+
            "verified" : false,
          "description":"",
+
            "id" : 1668562204,
          "profile_image_url":"http://tp4.sinaimg.cn/11055/50/0",
+
            "gender" : "m",
          "domain":"11055",
+
            "friends_count" : 611,
          "email":"",
+
            "screen_name" : "赵海俊的微薄",
          "qq":"525",
+
            "allow_all_act_msg" : false,
          "msn":"msn_525",
+
            "following" : false,
          "followers_count":24,
+
            "url" : "http://blog.sina.com.cn/eshesoulheart",
          "friends_count":51,
+
            "profile_image_url" : "http://tp1.sinaimg.cn/1668562204/50/1279885528/1",
          "statuses_count":0,
+
            "created_at" : "Thu Dec 10 00:00:00 +0800 2009",
          "favourites_count":0,
+
            "province" : "11",
          "created_at":"Thu Jan 01 08:00:00 +0800 1970",
+
            "location" : "北京 朝阳区"
          "following":false,
+
        },
          "geo_enabled":false,
+
        "favorited" : false,
          "verified":false},
+
        "thumbnail_pic" : "http://ww3.sinaimg.cn/thumbnail/63743d1cjw6dbz63h1rfrj.jpg",
    "status":
+
        "in_reply_to_user_id" : "",
        {"created_at":"Fri Jan 08 10:18:05 +0800 2010",
+
        "id" : 4046214423,
          "id":142314,
+
        "source" : "<a href=\"http://tech.sina.com.cn/\" rel=\"nofollow\">新浪科技</a>"
          "text":"lsdjfl55",
+
    }
          "source":"<a id=\"10013\" href=\"http://t.sina.com.cn/\" rel=\"nofollow\">SinaDestTop</a>",
+
}
          "favorited":false,
+
</pre>|
          "truncated":false,
+
useAge=
          "in_reply_to_status_id":"",
+
* 如果传入的评论ID不在登录用户的comments_by_me列表中,则返回400错误,提示40015:Error: not your own comment!|
          "in_reply_to_user_id":"",
+
otherInfo=
          "in_reply_to_screen_name":"",
+
===Java示例===
          "geo":null,
+
请从 [[SDK | 微博SDK开发包下载]] 下载Java SDK<br>
          "user":
+
代码示例如下:
                {"id":11075,
+
package weibo4j.examples;
                "screen_name":"name_11075",
+
                "name":"name_11075",
+
import weibo4j.Comment;
                "province":"0",
+
import weibo4j.Status;
                "city":"0",
+
import weibo4j.Weibo;
                "location":"",
+
                "description":"",
+
public class DeleteComment {
                "profile_image_url":"http://tp4.sinaimg.cn/11075/50/0",
+
                "domain":"11075",
+
/**
                "email":"",
+
* 删除评论,只能删除自己发布的评论
                "qq":"4102",
+
* @param args
                "msn":"msn_4102",
+
*/
                "followers_count":28,
+
public static void main(String[] args) {
                "friends_count":50,
+
System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
                "statuses_count":0,
+
    System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
                "favourites_count":34,
+
        try {
                "created_at":"Thu Jan 01 08:00:00 +0800 1970",
+
        Weibo weibo = getWeibo(true,args);
                "following":false,
+
        Status status = weibo.updateStatus("新增微博信息");
                "geo_enabled":false,
+
        Thread.sleep(1000);
                "verified":true},
+
        String sid = status.getId()+"";
          "apiState":3},
+
        System.out.println(sid + " : "+ status.getText()+" "+status.getCreatedAt());
    "apiState":3}
+
        Comment comment = weibo.updateComment("发表评论", sid, null);
 
+
        System.out.println(comment.getId() + " : " + comment.getText() + " " + comment.getCreatedAt());
 
+
        Thread.sleep(1000);
=== 使用示例===
+
        weibo.destroyComment(comment.getId());
 
+
} catch (Exception e) {
* xml:
+
e.printStackTrace();
curl -u user:password --http-request DELETE http://api.t.sina.com.cn/statuses/comment_destroy/1472669360.xml
+
}
 
+
}
* json:
+
curl -u user:password --http-request DELETE http://api.t.sina.com.cn/statuses/comment_destroy/1472669360.json
+
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 | 微博SDK开发包下载]] 处下载PHP SDK(支持OAuth验证之版本)<br>
 +
代码示例如下:
 +
<pre>
 +
//Statuses/comment destroy
 +
$c = new WeiboClient( WB_AKEY ,
 +
                      WB_SKEY ,
 +
                      $_SESSION['last_key']['oauth_token'] ,
 +
                      $_SESSION['last_key']['oauth_token_secret']  );
 +
//comment ID
 +
$c_id = "Comment ID";
 +
$msg = $c->oauth->post("http://api.t.sina.com.cn/statuses/comment_destroy/".$c_id.".json");
 +
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;
 +
}
 +
</pre>
 +
}}

2010年12月6日 (一) 11:51的最后版本

目录

statuses/comment_destroy/:id

删除评论。注意:只能删除登录用户自己发布的评论,不可以删除其他人的评论。

URL

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

支持格式

XML/JSON

HTTP请求方式

POST/DELETE

是否需要登录

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

请求数限制

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

请求参数

  必选 类型及范围 说明
source true string 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数)
:id true int64 欲删除的评论ID,该参数为一个REST风格参数。

注意事项

  • 如果传入的评论ID不在登录用户的comments_by_me列表中,则返回400错误,提示40015:Error: not your own comment!

返回结果

XML示例

<?xml version="1.0" encoding="UTF-8"?>
<comment>
  <created_at>Fri Dec 03 10:37:39 +0800 2010</created_at>
  <id>4977097789</id>
  <text>回复@zhangwei217245:walala</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>115</statuses_count>
    <favourites_count>3</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>
    <created_at>Thu Dec 02 17:14:39 +0800 2010</created_at>
    <id>4023227965</id>
    <text>哇哈哈。随便输了个经纬度,就跑到海里去发微博了</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>115</statuses_count>
      <favourites_count>3</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>
    <retweeted_status>
      <created_at>Thu Dec 02 17:06:40 +0800 2010</created_at>
      <id>4023064087</id>
      <text>abc</text>
      <source>
        <a href="">微博开放平台接口</a>
      </source>
      <favorited>false</favorited>
      <truncated>false</truncated>
      <geo xmlns:georss="http://www.georss.org/georss">
        <georss:point>39.8765 119.5678</georss:point>
      </geo>
      <in_reply_to_status_id/>
      <in_reply_to_user_id/>
      <in_reply_to_screen_name/>
      <thumbnail_pic>http://ww2.sinaimg.cn/thumbnail/6b85067djw6dbydsnam1xj.jpg</thumbnail_pic>
      <bmiddle_pic>http://ww2.sinaimg.cn/bmiddle/6b85067djw6dbydsnam1xj.jpg</bmiddle_pic>
      <original_pic>http://ww2.sinaimg.cn/large/6b85067djw6dbydsnam1xj.jpg</original_pic>
      <user>
        <id>1803880061</id>
        <screen_name>LoopB</screen_name>
        <name>LoopB</name>
        <province>11</province>
        <city>8</city>
        <location>北京 海淀区</location>
        <description/>
        <url/>
        <profile_image_url>http://tp2.sinaimg.cn/1803880061/50/0/0</profile_image_url>
        <domain/>
        <gender>f</gender>
        <followers_count>1</followers_count>
        <friends_count>1</friends_count>
        <statuses_count>21</statuses_count>
        <favourites_count>4</favourites_count>
        <created_at>Fri Aug 27 00:00:00 +0800 2010</created_at>
        <following>false</following>
        <verified>false</verified>
        <allow_all_act_msg>false</allow_all_act_msg>
        <geo_enabled>true</geo_enabled>
      </user>
    </retweeted_status>
    <annotations/>
  </status>
  <reply_comment>
    <created_at>Thu Dec 02 17:25:25 +0800 2010</created_at>
    <id>4949855625</id>
    <text>小新小新。。。我是小浪~~~</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>115</statuses_count>
      <favourites_count>3</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>
  </reply_comment>
</comment>

JSON示例

{
    "id" : 4976882559,
    "text" : "wakaka",
    "created_at" : "Fri Dec 03 10:28:55 +0800 2010",
    "user" : 
    {
        "name" : "zhangwei217245",
        "domain" : "zhangwei217245",
        "geo_enabled" : true,
        "followers_count" : 22,
        "statuses_count" : 115,
        "favourites_count" : 3,
        "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" : "北京 朝阳区"
    },
    "status" : 
    {
        "created_at" : "Fri Dec 03 09:25:51 +0800 2010",
        "text" : "维基解密新主机被曝位于军事掩体内(图) http://sinaurl.cn/hbqEya",
        "bmiddle_pic" : "http://ww3.sinaimg.cn/bmiddle/63743d1cjw6dbz63h1rfrj.jpg",
        "original_pic" : "http://ww3.sinaimg.cn/large/63743d1cjw6dbz63h1rfrj.jpg",
        "truncated" : false,
        "in_reply_to_status_id" : "",
        "annotations" : 
        [

        ],
        "in_reply_to_screen_name" : "",
        "geo" : null,
        "user" : 
        {
            "name" : "赵海俊的微薄",
            "domain" : "",
            "geo_enabled" : true,
            "followers_count" : 315,
            "statuses_count" : 2984,
            "favourites_count" : 53,
            "city" : "5",
            "description" : "运动健将",
            "verified" : false,
            "id" : 1668562204,
            "gender" : "m",
            "friends_count" : 611,
            "screen_name" : "赵海俊的微薄",
            "allow_all_act_msg" : false,
            "following" : false,
            "url" : "http://blog.sina.com.cn/eshesoulheart",
            "profile_image_url" : "http://tp1.sinaimg.cn/1668562204/50/1279885528/1",
            "created_at" : "Thu Dec 10 00:00:00 +0800 2009",
            "province" : "11",
            "location" : "北京 朝阳区"
        },
        "favorited" : false,
        "thumbnail_pic" : "http://ww3.sinaimg.cn/thumbnail/63743d1cjw6dbz63h1rfrj.jpg",
        "in_reply_to_user_id" : "",
        "id" : 4046214423,
        "source" : "<a href=\"http://tech.sina.com.cn/\" rel=\"nofollow\">新浪科技</a>"
    }
}

其他

Java示例

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

package weibo4j.examples;

import weibo4j.Comment;
import weibo4j.Status;
import weibo4j.Weibo;

public class DeleteComment {

	/**
	 * 删除评论,只能删除自己发布的评论
	 * @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);
       	Status status = weibo.updateStatus("新增微博信息");
       	Thread.sleep(1000);
       	String sid = status.getId()+"";
       	System.out.println(sid + " : "+ status.getText()+"  "+status.getCreatedAt());
       	Comment comment = weibo.updateComment("发表评论", sid, null);
       	System.out.println(comment.getId() + " : " + comment.getText() + "  " + comment.getCreatedAt());
       	Thread.sleep(1000);
       	weibo.destroyComment(comment.getId());
		} 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/comment destroy
$c = new WeiboClient( WB_AKEY , 
                      WB_SKEY , 
                      $_SESSION['last_key']['oauth_token'] , 
                      $_SESSION['last_key']['oauth_token_secret']  );
//comment ID
$c_id = "Comment ID";
$msg = $c->oauth->post("http://api.t.sina.com.cn/statuses/comment_destroy/".$c_id.".json");
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;
}
文档更新时间: 2010-12-06