简体   繁体   中英

any way to count twitter tweets of a particular user using Twitter API?

有没有人有任何想法或方法或代码(PHP)来查找使用Twitter API的特定用户的推文数量?

There is a way, you need to use the users/show resource,
you can find the documentation here and here's an output example

more precisely, you're looking for statuses_count


Here's a truncated output taken from the documentation page

{
"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,
[...]

since you can only return 200 at a time, i dont think you can.

More info: http://blog.twostepmedia.co.uk/retrieve-tweets-using-php-and-json/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM