[免登录] 腾讯微博API Beta 1.04发布页面[民间版]

更新:鉴于服务器压力考虑,暂时只提供API给 wordpress插件使用,见:http://zlz.im/wordpress-tencent-microblog/

[API Beta 1.04]

腾讯微博 API:http://Q.zlz.im/+你的昵称

当前版本:TX Microblog API 1.03

返回格式:json

支持调用:PHP Javascript 等各语言

获取方式:无须密码,只需 腾讯微博 ID

Json格式说明:[已经使用 json_encode()函数处理内容,请使用json_decode()解码]

具体条目说明:

{
data:{
timestamp:128679200,
hasnext:0,
totalnum:100,
info:[
{
text:"",
origtext:"",
count:2,
from:"来自网页",
id:7987543214334,
image:["",""],
name:"abc",
nick:"abcd",
uid:"xxxxxxxxx",
source:
{
text:"",
origtext:"",
count:2,
from:"来自网页",
id:7987543214334,
image:null,
name:"abc",
nick:"abcd",
uid:"xxxxxxxxx",
self:0
timestamp:1285813236,
type:1,
head:"",
location:"广东 深圳",
country_code:1,
province_code:44,
city_code:3,
isVip:0
geo:null,
status:0
},
self:0
timestamp:1285813236,
type:2,//表示转播
head:"",
location:"广东 深圳"
isVip:0
geo:null,
status:0
},
{
text:"",
origtext:"",
count:2,
from:"来自网页",
id:7987543214334,
image:null,
name:"abc",
nick:"abcd",
uid:"xxxxxxxxx",
self:0
timestamp:1285813236,
type:1,
head:"",
location:"广东 深圳"
isVip:0
geo:null,
status:0
}
]
}
,ret:0,
msg:"ok"
}

字段说明:

ret: 0 成功 非0失败
msg 错误信息
data:
	timestamp 服务器时间戳
	hasnext:0 表示还有微博可拉取 1 已拉取完毕
	info:
	text:微博内容
	origtext:原始内容
	count:微博被转次数
	from:来源
	id:微博唯一id
	image:图片url列表
	name:发表人帐户名
	nick:发表人昵称
	self:是否自已发的的微博0:不是 1 是
	timestamp:发表时间
	type:微博类型 1-原创发表、2-转载、3-私信 4-回复 5-空回 6-提及
	head:发表者头像url
	location:发表者所在地
	isvip:是否微博认证用户
	geo:发表者地理信息
	source:当type=2 时,source 即为源微博

PHP调用代码范例:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php
$jsonObject = file_get_contents('http://Q.zlz.im/YourID');
$decodedArray = json_decode($jsonObject, true);
echo 'Array ( [contents] => Array ( <br/>';
for($i = 0;$i < 10;$i++){
echo '['.$i.'] => Array ( <br/>[content] => '.$decodedArray[data][info][$i][origtext].'<br/>[time] => '.$decodedArray[data][info][$i][timestamp].'<br/>[from] => '.$decodedArray[data][info][$i][from].'<br/>)<br/>';
}
echo ')) ';
?>

测试地址:http://Q.zlz.im/demo.php?id=你的微博ID

本人的ID hzlzh_com:http://Q.zlz.im/demo.php?id=hzlzh_com

更新说明: ——–下一版预告———-

>下一版将增加参数,可选择是否获得转播及回复内容;

>提供以个最近发言一览的demo;

——–版本1.04———-

>去掉了个人信息资料的输出,因为显得无用;

>更新了1至10条的最近发言输出;

>继续优化语句,加快抓取处理速度;

>增加了 JS 调用的版本,见:http://Q.zlz.im/js/

——–版本1.03———-

>修改消息包含 个人发言,过滤了[转播][对话]消息;

>增加处理头像ICO 地址,用于获得未使用自定义头像用户的头像;

>优化部分处理语句,加快执行速度; >忽略抓取错误,设置请求最大超时;

——–版本1.02———-

>无须登录,获得腾讯微博相关信息;

>部分用户调用无法获取发言,只能获取个人信息;

>对外的第一版,问题很多,待解决;

PS1:编码,使用json,用UTF-8;

PS2:个别腾讯微博用户的部分信息无法正常显示;[特指:转播,对话等消息,个人发言正常]

PS3:有问题本文留言或腾讯微博–>@hzlzh_com ,Twi-t-ter请走–> @hzlzh_com

鉴于API尚未完善,且考虑到久远的存活能力,暂时请不要索取实现原理,谢谢! 问题很多,最近很忙,等更新吧! 已见别人发了这方面的,我也发了只求先占坑,待我更新!

至于有了 API 怎么折腾:见 同步腾讯微博到Wordpress[附 缓存版]

腾讯微博同步wordpress

版权所有© HzlzH | 本文采用 BY-NC-SA 进行授权
转载需注明 转自: 《[免登录] 腾讯微博API Beta 1.04发布页面[民间版]

相关文章

{ Leave a Reply ? }

  1. 轩辕十四 New Zealand Internet Explorer Windows

    :-D

  2. 万戈 China Mozilla Firefox Windows

    有点意思,呵呵,期待成品

  3. lopo.yang China Internet Explorer Windows

    腾讯微博观光团. 8)

  4. 阿邙 China SouGou Browser Windows

    最近很多人都自制成功了啊 强大 :-o

  5. 林木木 China Google Chrome Windows

    暴力解析?

  6. 网上赚钱的方法 China Internet Explorer Unknow Os

    感谢博主的文章,下次我还看

  7. 劲博客 China Internet Explorer Windows

    微博挺多选择,哪个更好?

  8. 如何减肥 China Internet Explorer Windows

    不会用

  9. 蓝冰 China Mozilla Firefox Windows

    有点牛逼 :mrgreen:

  10. 小强 China Internet Explorer Windows

    :mrgreen: 帅哥“你不会是用PHP直接解析 http://t.qq.com/hzlzh_com 这个地址把““

      • 小强 China Internet Explorer Windows

        @HzlzH, 我说的也是范例~~~
        你个家伙竟然用了URLRewrite!

          • 小强 China Internet Explorer Windows

            @HzlzH, :mrgreen: 必须的!
            MD“`我的破站就因为静态链接弄了俩月才弄好~~~

            不嘛不嘛~~我不要Windows主机~~~

          • 小强 China Internet Explorer Windows

            @HzlzH, 推荐Linux主机几款给我参考~~~

      • 靖ゞGёGё China Mozilla Firefox Windows

        @HzlzH: 他一定用socket 登陆他自己的号获取的,腾讯那个ajax接口需要登录验证的 ……..

  11. oblue China Google Chrome Windows

    啊啊,牛人就是多》。。。
    TX估计要想办法了》。。 :lol: :lol:

  12. Neeke China Mozilla Firefox Windows

    :-D 原理我已公布,不知道大家是不是同一个思路。

    • ahu China Internet Explorer Windows

      @Neeke: 我认为他其实是用自己帐号登录,然后就可以浏览任何人的微博了,于是取到了别人的内容。和你的程序相比 应该原理一样的

  13. houkai China Internet Explorer Windows

    好东西 期待官方api早点公布出来 :wink:

  14. zwwooooo China Mozilla Firefox Windows

    厉害,都做api了

  15. 小强 China Internet Explorer Windows

    哈哈~~不是很稳定哦~~

  16. 呵呵 China Internet Explorer Windows

    呵呵 稳定撒

  17. knowrui China SouGou Browser Windows

    用javascript调用API时,怎么给其中某一部分添加链接?
    比如这么一条微博:
    王瑞刚:祝福天下有情人! 发表于 [2小时前] 来自 [QQ]
    怎么给“王瑞刚”“QQ”添加链接?

      • knowrui China SouGou Browser Windows

        @HzlzH: 还有一个问题,微博认证用户后面有一个认证图标,http://q.zlz.im/js/这个页面的代码原封不动调用的话,图标部分会出现无法显示的错误,你试试调用knowrui的微博即知。

  18. GodSon China Internet Explorer Windows

    :mrgreen: 我也有哦···

  19. 可惜喂鸡 China Internet Explorer Windows

    呵呵,网上一样想法的人真多。 :mrgreen:
    你说不准要实现原理那我不要,不过感觉上来说你的实现原理相比我的效率更高些。
    http://www.btboys.com/t/?mbname=hzlzh_com

  20. joyla China Google Chrome Windows

    :-o :-o 期待成品。

  21. 向晚 China Google Chrome Windows

    可以做个rss输出吗?

  22. winky China 360 Browser Windows

    呵呵,挺好的,学习一下。 :-D

  23. 郑永 Argentina Mozilla Firefox Windows

    代码有问题啊,那个时间无法截取。

  24. 魏星博客 China Google Chrome Windows

    挂了,不能用了!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

:wink: :twisted: :roll: :oops: :mrgreen: :lol: :idea: :evil: :cry: :arrow: :?: :-| :-x :-o :-P :-D :-? :) :( :!: 8-O 8)

Pingback & Trackback

  1. 同步腾讯微博到Wordpress[附 缓存版] United States WordPress Unknow Os - Pingback on 2010/06/25/ 22:47
  2. 与公告结合的jQuery文字轮换效果 |阿邙´S Blog United States WordPress Unknow Os - Pingback on 2010/07/19/ 08:37
  3. 3Pmm » Blog Archive » 同步腾讯微博到Wordpress[附 缓存版] China WordPress Unknow Os - Pingback on 2010/08/12/ 09:35