使用Twitter API有没有一种方法可以计算特定用户的推文数量?

6

有没有人知道或者有什么方法或者PHP代码可以使用Twitter API查找特定用户的推文数量?

2个回答

6
有一种方法,你需要使用users/show资源,
你可以在这里找到文档(链接),这是一个输出示例
更精确地说,你要找的是statuses_count
这是从文档页面中截取的缩略输出。
{
"name": "Twitter API",
"profile_sidebar_border_color": "87bc44",
"profile_background_tile": false,
"profile_sidebar_fill_color": "e0ff92",
"location": "San Francisco, CA",
"profile_image_url": "http://a3.twimg.com/profile_images/689684365/api_normal.png",
"created_at": "Wed May 23 06:01:13 +0000 2007",
"profile_link_color": "0000ff",
"favourites_count": 2,
"url": "http://apiwiki.twitter.com",
"contributors_enabled": true,
"utc_offset": -28800,
"id": 6253282,
"profile_use_background_image": true,
"profile_text_color": "000000",
"protected": false,
"followers_count": 160752,
"lang": "en",
"verified": true,
"profile_background_color": "c1dfee",
"geo_enabled": true,
"notifications": false,
"description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
"time_zone": "Pacific Time (US & Canada)",
"friends_count": 19,
"statuses_count": 1858,
[...]

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接