Pogostick Extension - updateStatus

Im currently new to YII framework and my project require me to post twitter status updates via oauth. I have the oauth token working for the authorized user. I ran the verifyCredentials() function and I sucessfully return data. When I try to use the updateStatus is where I get the error below.

Error::

Error making OAuth fetch request in CPSTwitterApi: {Invalid auth/bad

request (got a 400, expected HTTP/1.1 20X or a redirect)}

Addition Question :: CPSApiComponent.php

This file has the following ($_sResults = $this->makeHttpRequest( $_sUrl, $_sQuery, ‘GET’, $this->userAgent );)

Should this be POST instead of GET? From the comments in the CPSTwitterApi.php the updateStatus function says " Request must be a POST."


My code:

Yii::app()->twitter->loadData($arTwitterUser[1], $arTwitterUser[0], true, array(‘oauth_token’ => $arTwitterOAuth[0],‘oauth_token_secret’ => $arTwitterOAuth[1]));

					 echo Yii::trace(CVarDumper::dumpAsString(Yii::app()->twitter->checkLoadData()),'vardump');

$_arResults = Yii::app()->twitter->verifyCredentials(); // Works

echo Yii::trace(CVarDumper::dumpAsString($_arResults),‘vardump’);

$_arResults = Yii::app()->twitter->updateStatus(‘This is a test of Twitter API’);

echo Yii::trace(CVarDumper::dumpAsString($_arResults),‘vardump’); // Doesnt

I have exactly the same problem, and after looking around with google, it seems it’s not an easy one to fix. Did you manage to fix it?

[edit]] I got it working with php 5.3. I had to modify the files CPSTwitterApi.php and the file CPSOAuthComponent.php to make it work. Mabe the library was designed for an older version of PHP and was not compatible with the latest version of PHP.

In CPSTWitterApi.php




//$_arOptions =& $this->getOptions();

//$_arOptions[ 'requestMap' ][ $_sLastController ][ $sAction ] = array( 'params' => $arParams, 'options' => $arOptions, 'controller' => $_sLastController );

$this->requestMap[ $_sLastController ][ $sAction ] = array( 'params' => $arParams, 'options' => $arOptions, 'controller' => $_sLastController );

In CPSOAuthComponent.php




$_arMap = ( isset( $this->requestMap[ $this->apiToUse ][ $sAction ] ) ) ? $this->requestMap[ $this->apiToUse ][ $sAction ] : null;

$_arOptions = ( isset( $_arMap[ 'options' ] ) ) ? $_arMap[ 'options' ] : null;

$_arReqOneOf = ( isset( $_arOptions[ '_requireOneOf' ] ) ) ? $_arOptions[ '_requireOneOf' ] : null;

if (isset( $_arOptions[ '_method' ] )) $_sMethod=$_arOptions[ '_method' ];

else {

    if ($sMethod!==null) {

        $_sMethod=$sMethod;

    } else {

        $_sMethod=CPSApiBehavior::HTTP_GET;

    }

}

 

$_arParams = ( isset( $_arMap[ 'params' ] ) ) ? $_arMap[ 'params' ] : null;