开发者

Using Twitter API to return number of tweets from an account

开发者 https://www.devze.com 2023-02-03 06:29 出处:网络
I would like to return the total number of tweets an account has usi开发者_如何学Gong the Twitter API. Anybody know how to do that?You haven\'t specified a language, but per the Twitter API Docs, you

I would like to return the total number of tweets an account has usi开发者_如何学Gong the Twitter API. Anybody know how to do that?


You haven't specified a language, but per the Twitter API Docs, you call

'/users/show'

The element (json or xml) returned is 'statuses_count' which is the total number of tweets a user has sent.

http://apiwiki.twitter.com/w/page/22554755/Twitter-REST-API-Method:-users%C2%A0show


Twitter API 1.1 http request to use...

https://api.twitter.com/1.1/users/show.json?screen_name=accountScreenName;

Decode the json...

$jsonOutput = json_decode($jsonData);

Below is where to find number of total tweets from the account...

$jsonOutput->statuses_count;
0

精彩评论

暂无评论...
验证码 换一张
取 消