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