Twitter Login And Tweet

I have a twitter login script how can i modify it so that when the person use it to login to my site it tweets a message into there account and follow me.

 * twitter authentication script based on
 * pecl oauth extension
$oauthc = new OAuth($oauth['twitter']['consumerkey'],
if(empty($_SESSION['trequest_token_secret'])) {
    //get the request token and store it
    $request_token_info = $oauthc->getRequestToken($oauth['twitter']['requesttokenurl']); //get request token
    $_SESSION['trequest_token_secret'] = $request_token_info['oauth_token_secret'];
    header("Location: {$oauth['twitter']['authurl']}?oauth_token=".$request_token_info['oauth_token']);//forward user to authorize url
else if(empty($_SESSION['taccess_oauth_token'])) {
    //get the access token - dont forget to save it 
    $request_token_secret = $_SESSION['trequest_token_secret'];
    $oauthc->setToken($_REQUEST['oauth_token'],$request_token_secret);//user allowed the app, so u
    $access_token_info = $oauthc->getAccessToken($oauth['twitter']['accesstokenurl']);
    $_SESSION['taccess_oauth_token']= $access_token_info['oauth_token'];
    $_SESSION['taccess_oauth_token_secret']= $access_token_info['oauth_token_secret'];
if(isset($_SESSION['taccess_oauth_token'])) {
    //now fetch current users profile
    $access_token = $_SESSION['taccess_oauth_token'];
    $access_token_secret =$_SESSION['taccess_oauth_token_secret'];
    $data = $oauthc->fetch('');
    $response_info = $oauthc->getLastResponse();
    echo "<pre>";
    echo "</pre>";

Twitter login script may also keep your account secured. But, I am also interested on how we are going to modify the twitter login. If ever that someone will be interested to log in on a particular site, there will be corresponding tweets that will follow. I found automatic twitter status update script - twitter script to login and tweet, but this is not what I need.

Sponsor our Newsletter | Privacy Policy | Terms of Service