AndrewFerrara Posted January 31, 2011 Share Posted January 31, 2011 Alight, I'm trying to figure out the error string for an api http://www.haloreachapi.net/wiki/API_rate_limits The wiki says the limit is 300rpm I tried to run this in two tabs on my browser still won't give me the error string, how can it be done faster? P.s. Api key will be changed in the near future don't waste your time.. <?php $gamertag = "l RaH l"; $url = "http://www.bungie.net/api/reach/reachapijson.svc/game/metadata/30cRxVA9J73esG388CzmOXUVRo5VjYhSfI2qBaqcMzs="; $t_start = microtime(true); for($i = 0; $i < 301; $i++) { $file = file_get_contents($url); echo "Iteration ".($i + 1)."<br>\n"; } $exectime = microtime(true) - $t_start; echo "Execution time: " . round($exectime, 4) . "<br><br>\n\n"; $json = json_decode($file, 1); print_r($json); ?> Quote Link to comment Share on other sites More sharing options...
btherl Posted January 31, 2011 Share Posted January 31, 2011 How about three tabs? How long does each request take? Eg if each request takes 0.5 seconds on average, you'll need three tabs to make 300 requests in a minute. You can do the requests in parallel in php but that's much trickier than just running multiple copies of the script. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.