Twitter rate limit error in while loop

Tuesday, November 3, 2015

I am saving tweets id on my DB from twitter api whenever there is a new tweet. What I am trying to achieve is loop through the tweet id to whom who retweet it using below code, Initially I loop 5 results but its showing RATE LIMIT EXCEEDED. The API is returning results with single tweet id but on while loop showing Rate limit error, Any optimized solution for this without rate limit error.



if (mysqli_num_rows($mediaQuery) > 0) {
while ($row = mysqli_fetch_assoc($mediaQuery)) {
$tweet_id=$row['tweet_id'];
$tweet1 = $twitter_conn->get('statuses/retweeters/ids.json?id=$tweet_id&count=100&stringify_ids=true');
var_dump($tweet1);
}}

0 comments:

Post a Comment