Well, I’m tickled pink to have found this after spending the last few days digging around my code trying to fix this…thing that wasn’t broken. This is no good for cats like me who struggle mightily with API codes and the like.
That said, maybe someone can see where I botched this?
I’ve downloaded the latest Twitteroauth package, and run the test.php successfully, I’;m connected to my app, the works, but I’m not able to post to my status. Can anyone see where my code has gone south?
require_once(‘twitteroauth_master/twitteroauth/twitteroauth.php’);
require_once(‘twitteroauth_master/config.php’);
session_start();
/* If the oauth_token is old redirect to the connect page. */
if (isset($_REQUEST[‘oauth_token’]) && $_SESSION[‘oauth_token’] !== $_REQUEST[‘oauth_token’]) {
$_SESSION[‘oauth_status’] = ‘oldtoken’;
header(‘Location: ./clearsessions.php’);
}
/* Create TwitteroAuth object with app key/secret and token key/secret from default phase */
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION[‘oauth_token’], $_SESSION[‘oauth_token_secret’]);
/* Request access tokens from twitter */
$access_token = $connection->getAccessToken($_REQUEST[‘oauth_verifier’]);
$content = $connection->get(‘account/verify_credentials’);
$connection->post(‘statuses/update’, array(‘status’ => $tmessage));
I’m at my wits end…as I’m sure many others are, as well…any and all insight is appreciated.