Jump to content

[SOLVED] Unexpected T_OBJECT_OPERATOR


Akenatehm

Recommended Posts

Hey Guys,

 

I am getting this error:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ')' in /home/livetwee/public_html/internal/index.php on line 81

 

with this:

<?php
case 'returned':
    /* If the access tokens are already set skip to the API call */
    if ($_SESSION['oauth_access_token'] === NULL && $_SESSION['oauth_access_token_secret'] === NULL) {
      /* Create TwitterOAuth object with app key/secret and token key/secret from default phase */
      $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION['oauth_request_token'], $_SESSION['oauth_request_token_secret']);
      /* Request access tokens from twitter */
      $tok = $to->getAccessToken();

      /* Save the access tokens. Normally these would be saved in a database for future use. */
      $_SESSION['oauth_access_token'] = $tok['oauth_token'];
      $_SESSION['oauth_access_token_secret'] = $tok['oauth_token_secret'];
    }
    /* Random copy */
    $content = 'your account should now be registered with twitter. Check here:<br />';
    $content .= '<a href="https://twitter.com/account/connections">https://twitter.com/account/connections</a>';

    /* Create TwitterOAuth with app key/secret and user access key/secret */
    $to = new TwitterOAuth($consumer_key, $consumer_secret);
    $tok = $to->getRequestToken();
    $request_link = $to->getAuthorizeURL($token);
    $tok = $to->getAccessToken();
    $to = new TwitterOAuth($consumer_key, $consumer_secret, $user_access_key, $user_access_secret);
    $content = $to->OAuthRequest('https://twitter.com/account/verify_credentials.xml', array(), 'GET');
LINE 81 - >>$content = $to->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' -> 'Test OAuth update. #testoauth'), 'POST');

    /* Run request on twitter API as user. */
    //$content = $to->OAuthRequest('https://twitter.com/account/verify_credentials.xml', array(), 'GET');
    //$content = $to->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' => 'Test OAuth update. #testoauth'), 'POST');
    //$content = $to->OAuthRequest('https://twitter.com/statuses/replies.xml', array(), 'POST');
    break;
}/*}}}*/
?>

Link to comment
https://forums.phpfreaks.com/topic/155016-solved-unexpected-t_object_operator/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.