Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is snippted i am using which works fine. </p> <p>First make sure of the follownig In dev twitter, you app can read / write Refresh consumer key, Recreate access token.</p> <p>If the folling is not working, the problem lies elsewhere t is something else! see <a href="https://dev.twitter.com/search/apachesolr_search/HTTP%20CODE%200" rel="nofollow">https://dev.twitter.com/search/apachesolr_search/HTTP%20CODE%200</a></p> <p>Please read instructions, FOLLOW THEM and YOUR CODE will WORK</p> <pre><code>&lt;?php require_once('twitteroauth.php'); session_start(); /* * INSTRUCTIONS!!! * https://dev.twitter.com/ * create app * https://dev.twitter.com/ TAB settings * website: THE_URL_TO_YOUR_SCRIPT_WITH_THIS_CODE * callback_url http://www.YOURDOMAIN.COM/ * Read, Write and Access direct messages ! * Allow this application to be used to Sign in with Twitter * GO BACK TO DETAILS RECREATE / REFRESH - ACCESS TOKEN! */ $consumerKey = '******************'; $consumerSecret = '******************'; $oAuthToken = '*********************'; $oAuthSecret = '**************************'; // The TwitterOAuth instance $twitteroauth = new TwitterOAuth($consumerKey, $consumerSecret); // Requesting authentication tokens, the parameter is the URL we will be redirected to $request_token = $twitteroauth-&gt;getRequestToken('http://DOMAIN.com/YOURLOGINSCRIPT.php'); // Saving them into the session $_SESSION['oauth_token'] = $request_token['oauth_token']; $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret']; // If everything goes well.. if($twitteroauth-&gt;http_code==200){ // Let's generate the URL and redirect $url = $twitteroauth-&gt;getAuthorizeURL($request_token['oauth_token']); header('Location: '. $url); } else { // It's a bad idea to kill the script, but we've got to know when there's an error. die('Something wrong happened.'); } ?&gt; </code></pre>
 

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