Trends
(创建新页面为 '== trends == 获取某人话题。 === URL=== http://api.t.sina.com.cn/trends.format === 格式=== xml, json === HTTP请求方式=== GET === 是否需要身份验证=== fa…') |
(→返回结果) |
||
第27行: | 第27行: | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
− | + | <trends> | |
− | + | ||
<trend> | <trend> | ||
− | |||
<trend_id>null</trend_id> | <trend_id>null</trend_id> | ||
− | |||
<hotword>ddddsss</hotword> | <hotword>ddddsss</hotword> | ||
− | |||
<num>1</num> | <num>1</num> | ||
− | |||
</trend> | </trend> | ||
− | |||
<trend> | <trend> | ||
− | |||
<trend_id>null</trend_id> | <trend_id>null</trend_id> | ||
− | |||
<hotword>dddd</hotword> | <hotword>dddd</hotword> | ||
− | |||
<num>14881</num> | <num>14881</num> | ||
− | |||
</trend> | </trend> | ||
− | |||
</trends> | </trends> | ||
− | |||
− | |||
</trends> | </trends> | ||
− | |||
JSON示例: | JSON示例: | ||
[{"num":"1","trend_id":"876637","hotword":"ddddsss"},{"num":"14881","trend_id":"876636","hotword":"dddd"}] | [{"num":"1","trend_id":"876637","hotword":"ddddsss"},{"num":"14881","trend_id":"876636","hotword":"dddd"}] | ||
− | |||
=== 使用示例=== | === 使用示例=== |
2010年10月18日 (一) 18:26的版本
目录 |
trends
获取某人话题。
URL
http://api.t.sina.com.cn/trends.format
格式
xml, json
HTTP请求方式
GET
是否需要身份验证
false
请求数限制
true
请求参数
- user_id: 选填参数,要获取用户的uid。
- page: 选填参数.页码。缺省为1。
- 示例: http://api.t.sina.com.cn/trends.xml?user_id=12345&page=1
- count: 选填参数.单页显示数。缺省为10
- 示例: http://api.t.sina.com.cn/trends/weekly.xml?exclude=10
返回结果
XML示例:
<?xml version="1.0" encoding="UTF-8"?>
<trends>
<trend> <trend_id>null</trend_id> <hotword>ddddsss</hotword> <num>1</num> </trend> <trend> <trend_id>null</trend_id> <hotword>dddd</hotword> <num>14881</num> </trend> </trends> </trends>
JSON示例:
[{"num":"1","trend_id":"876637","hotword":"ddddsss"},{"num":"14881","trend_id":"876636","hotword":"dddd"}]
使用示例
- xml:
- curl -u uid:password http://123.125.104.29/trends.xml -d "source=1392673069&user_id=1734528095&page=1&count=10"
- json:
- curl -u uid:password http://123.125.104.29/trends.json -d "source=1392673069&user_id=1734528095&page=1&count=10"