Note that there are some explanatory texts on larger screens.

plurals
  1. POAuto Post on Twitter after authentication : getting Invalid access token error
    primarykey
    data
    text
    <p>Here I need to automatically post on Twitter after authentication.</p> <p>My code </p> <pre><code>&lt;?php session_start(); include("twitteroauth.php"); define('CONSUMER_KEY','zubLdCze6Erz9SVNIgG3w'); define('CONSUMER_SECRET','ZnZQ77bNnpBER2aSxTQGEXToAQODz9qEBSAXIdeYw'); define('OAUTH_CALLBACK','http://dev.pubs.positive-dedicated.net/Licensee/addPubEventWeekly.php'); /* Build TwitterOAuth object with client credentials. */ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); /* Get temporary credentials. */ $request_token = $connection-&gt;getRequestToken(OAUTH_CALLBACK); /* Save temporary credentials to session. */ $_SESSION['oauth_token'] = $token = $request_token['oauth_token']; $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret']; switch ($connection-&gt;http_code) { case 200: /* Build authorize URL and redirect user to Twitter. */ $url = $connection-&gt;getAuthorizeURL($token); header('Location: ' . $url); break; default: /* Show notification if something went wrong. */ echo 'Could not connect to Twitter. Refresh the page or try again later.'; } ?&gt; </code></pre> <p>and </p> <pre><code>ksort($_SESSION); $tweet = new TwitterOAuth('zubLdCze6Erz9SVNIgG3w','ZnZQ77bNnpBER2aSxTQGEXToAQODz9qEBSAXIdeYw',$_SESSION['oauth_token'],$_SESSION['oauth_token_secret']); print_r($tweet); $account = $tweet-&gt;get('account/verify_credentials'); $message = "This is an example twitter post using PHP"; $postVal = $tweet-&gt;post('statuses/update', array('status' =&gt; $message)); </code></pre> <p>But here I am getting "Invalid/Expired access token" Error.</p> <p>I have changed twittreauth.php library file also from 1.0 to 1.1 from here</p> <pre><code>public $host = "https://api.twitter.com/1.1/"; </code></pre> <p>Please suggest how to fix this</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload