Reputation: 954
I have used this code below to get the followers of a particular user. But there are times that some tumblr blogs are not showing from the response.
$oauth = new OAuth($conskey,$conssec);
$oauth->fetch("http://api.tumblr.com/v2/user/following", array('offset'=>0) ,OAUTH_HTTP_METHOD_GET);
$following_list = json_decode($oauth->getLastResponse());
I am not sure if those blogs have done something to their settings that makes them invisible from the response of the API request.
Anyone experience this kind of problem with Tumblr API requests? How do I go around with this problem for me to view the complete list of followers?
Thank you in advance.
Upvotes: 3
Views: 1287
Reputation: 25
I have done the same thing, and noticed that my followers have been over-counted as well. I have sent Tumblr Support an email as well, but they have not gotten back to me.
To know the true number, you can always hand count and account for duplicates. I am lazy (read as: a developer) and just have a Ruby script that does it for me.
Upvotes: 1
Reputation: 51
Do you mean you can the array return something like
[response] => stdClass Object
(
[total_blogs] => 29
[blogs] => Array
(
[0] => stdClass Object
(
[name] => papertissue
[url] => http://papertissue.tumblr.com/
[updated] => 1360904405
)
[1] => stdClass Object
(
[name] => lunchbagart
[url] => http://lunchbagart.tumblr.com/
[updated] => 1361159341
)
[2] => stdClass Object
(
[name] => pacegallery
[url] => http://pacegallery.tumblr.com/
[updated] => 1360951263
)
...
[19] => stdClass Object
(
[name] => rulesformyunbornson
[url] => http://rulesformyunbornson.tumblr.com/
[updated] => 1360770089
)
)
)
and you can only see 20 responses right? You will need to run the command again with the offset command and tell it to start at post 21
like this user/following/?offset=21
Basically you can take the value of total_blogs and divide it by 20 to find the number of times to run the command(in a for loop for example) and increase the offset by 20 each time to give you the complete list.
Please let me know if this helps or maybe you meant something else.
Upvotes: 1