Paul,

If you are referring to the twitter-async example you posted, I have installed that and I'm working with it now.

I assume the first time through it's meant to take a detour through a Twitter authorization, then back to the same script in which oauth_token and secret is set... and dumped...

Looks like I'm not getting a proper authorize URL, and in fact the script dies at that call. No output. Maybe someone can eyeball what's going wrong.

Here's what the stack trace says, followed by the script

(the names and places have been changed to protect the innocent)

<b>Fatal error</b>: Uncaught exception 'EpiOAuthException' in /path/ twitter-async/EpiOAuth.php:397
Stack trace:
#0 /path/twitter-async/EpiOAuth.php(367): EpiOAuthException::raise (Object(EpiCurlManager), false) #1 /path/twitter-async/EpiOAuth.php(47): EpiOAuthResponse-&gt;__get ('oauth_token') #2 /path/twittertest-oauth2.php(29): EpiOAuth-&gt;getAuthorizeUrl (NULL, Array)
#3 {main}
thrown in <b>/path/twitter-async/EpiOAuth.php</b> on line <b>397</ b><br />

<?php

require_once "classes/twitter-async/EpiCurl.php";
require_once "classes/twitter-async/EpiOAuth.php";
require_once "classes/twitter-async/EpiTwitter.php";

define( "CONSUMER_KEY", "$MY_CONSUMER_KEY" );  // actual key used
define( "CONSUMER_SECRET", "$MY_CONSUMER_SECRET" ); // actual secret used

$twitter = new EpiTwitter( CONSUMER_KEY, CONSUMER_SECRET );

if( isset( $_GET["oauth_token"] ) ){
try{
$twitter->setToken( $_GET["oauth_token"] );
$token = $twitter->getAccessToken( array( "oauth_verifier" => $_GET ["oauth_verifier"] ) );
var_dump( $token->oauth_token, $token->oauth_token_secret );
}
catch( Exception $e )
{
var_dump( get_class( $e ) );
}
}else{
$location = $twitter->getAuthorizeUrl(null,array("oauth_callback" => "http://www.mydomain.tld/dir/twittertest-oauth2.php ")); // same address as this script
header("Location: $location");
exit;
}
?>




On Jul 22, 2010, at 5:53 PM, Paul wrote:

Hi Paul,

Is there a way to retrieve the consumer keys for the other Twitter
account I own without registering an app?

Yep, if you use that script given previously, just login to the other
Twitter account instead (with the same consumer key/secret.  This will
give you a different pair of tokens for the second account.

Initialise as in tweeting example with the new token.  Basically what
you're doing is authorising the same app for both accounts.

- Paul


Reply via email to