Rate Limit does not seem to be increasing to 350 per user


#1

Hi, all

I am developing a twitter based website and have been facing the rate limit issue for a while now. I was able to authenicate my application using the Zend Framework but it does not seem to be increasing the limits to 350. I’m not sure exactly what is going wrong. Any suggestions as to what maybe happening?

Below is a copy of my code I used along side the Zend framework:

Login.php page

<?php $config = array( 'callbackUrl' => 'http://mashups.arenthard.co.uk/oo/index.html', 'siteUrl' => 'https://api.twitter.com/oauth/authorize', 'consumerKey' => '6jN1vBeBXxKiJtFnsQ', 'consumerSecret' => 'XXXXX' ); $consumer = new Zend_Oauth_Consumer($config); // fetch a request token $token = $consumer->getRequestToken(); // persist the token to storage $_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token); // redirect the user $consumer->redirect(); // Now that we have an Access Token, we can discard the Request Token $_SESSION['TWITTER_REQUEST_TOKEN'] = null; } else { // Mistaken request? Some malfeasant trying something? exit('Invalid callback request. Oops. Sorry.'); } ?>


Callback.php page 
<?php session_start(); //set_include_path('Zend'); require ('Oauth/Consumer.php'); $config = array( 'callbackUrl' => 'http://mashups.arenthard.co.uk/oo/index.html', 'siteUrl' => 'https://api.twitter.com/oauth/authorize', 'consumerKey' => '6jN1vBeBXxKiJtFnsQ', 'consumerSecret' => 'XXXXX' ); $consumer = new Zend_Oauth_Consumer($config); if (!empty($_GET) && isset($_SESSION['TWITTER_REQUEST_TOKEN'])) { $token = $consumer->getAccessToken($_GET, unserialize($_SESSION['TWITTER_REQUEST_TOKEN'])); // Now that we have an Access Token, we can discard the Request Token $_SESSION['TWITTER_REQUEST_TOKEN'] = null; } else { // Mistaken request? Some malfeasant trying something? exit(‘Invalid callback request. Oops. Sorry.’); } // save token to file file_put_contents(‘token.txt’, serialize($token)); ?>





Thanks
Kirti

#2

In the future you should be much more careful about posting your consumer_secret in a public forum.

If you don’t think you’re being rate limited properly, it probably means your OAuth requests aren’t actually valid and you’re being evaluated as unauthenticated. Look for X-Warning HTTP headers telling you whether your auth is working or not. If it’s not, review the many tips of [node:204].


#3

Hi Taylor,

Thanks, I will keep that in mind next time I post something on a forum.
I have looked at my website HTTP headers but can only find information such a the date, content-type and server, but nothing about the X-Warning HTTP headers?

Any help please?


#4

Hiya,

I am working on the same project. I am struggling to understand if the rate limit is user login driven or machine driven (i.e. IP Address)
Thanks!