I am trying to make an android app for twitter using scribe-java.
i can tweet with my application so the authentification is successfull i think but i am unable to read timelines.
when i do a timeline request i receive en 200 response with empty body.
com
#2
I’m having the same problem. Did you find a solution?
Update: I found my problem. I was including the parameter max_id with an initial value of 999999999999999999. The statuses/home_timeline API seems to stop allowing this around May 2018, which is when this stopped working for me. Now I solved the problem by excluding the max_id value until I know a real id value from the result set, then include that real value as a max_id parameter in the next request, like this:
private function homeTimeline($screen_name, $max_results=9999999)
{
$full_list = array();
$max_id = null;
do {
$this->limitSleepHandler();
$params = array('count' => min(200, $max_results), 'screen_name' => $screen_name);
if (isset($max_id)) {
$params = array_merge($params, array('max_id' => $max_id));
}
$result = $this->toa->get('statuses/home_timeline', $params);
$this->handleError($result, 'GET: statuses/home_timeline', $params);
if (empty($result)) {
break;
}
$last_result = end($result);
$max_id = isset($last_result->id) ? $last_result->id - 1 : $max_id;
$full_list = array_merge($full_list, $result);
fwrite(STDERR, sprintf("Got %s/%s of timeline\n", sizeof($full_list), $max_results));
} while (!empty($result) && sizeof($full_list) < $max_results);
return $full_list;
}
system
Closed
#3
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.