Latest: buggy behaviour of parent:: in PHP 5.3.3

Content with Style

Web Technique

Zend_Client_Twitter with OAuth and a single access token

by Pascal Opitz on September 26 2010, 16:26

Just noticed that twitter switched their API to OAuth only, which broke our blog updates on twitter. Here's a hotfix to use the single access token provided by Twitter.


Of course you'll have to get the right data from

twitter.user = "myusername"
twitter.consumer_key = "xxxxxx"
twitter.consumer_secret = "yyyyyy"
twitter.access_token = "XXXXXX"
twitter.access_secret = "YYYYYY"


$message = "my update";

$token = new Zend_Oauth_Token_Access();

$twitter_client = $token->getHttpClient(array(
    'callbackUrl' => '',
    'siteUrl' => '',
    'consumerKey' => $this->config->twitter->consumer_key,
    'consumerSecret' => $this->config->twitter->consumer_secret,

$twitter = new Zend_Service_Twitter(array(
    'username' => $this->config->twitter->user,
    'accessToken' => $token,

$response = $twitter->account->verifyCredentials();


Don't miss the opportunity to leave the first comment.

Leave your comment

Comments are moderated.
Tags allowed: a, strong, em, code, ul, ol, li, q, blockquote, br, p