I'm afraid I spoke to soon. Things are not quite working.

I am able to authorize tweeting through the new API, but I am not able
to tweet yet.

When I first tried, I got back a message from this tweet operation:

   $to->OAuthRequest( "https://twitter.com/statuses/update.xml";,
                      array('status' => $expanded_txt, 'POST') );

which said,

        Warning:  Missing argument 3 for TwitterOAuth::oAuthRequest(),
called in ... and defined in .../twitterOAuth.php on line 178

I looked at the code and concluded that the third parameter should be
NULL. I added that and got this from PHP:

        Notice:  Array to string conversion in .../OAuth.php</b> on
line 373

and from the tweet call:

        <error>Could not authenticate you.</error>

Oauth.php lines 373 says

        return strtoupper($this->http_method);

I traced the value in http_method back to the second parameter of
twitterOAuth::oAuthRequest. I saw that instead of returning an array
which contained, among other things, the scalar 'POST', the second
parameter should just be 'POST'.

Accordingly, I changed the call to:

   $to->OAuthRequest( "https://twitter.com/statuses/update.xml";,
                      'POST', NULL );

and got a return value that contained this:

        <error>Client must provide a 'status' parameter with a value.</

...which makes perfect sense, since the "status" element of the array
contains the text of the tweet!

I'm not sure what's happening here. It appears that one part of the
code requires OAuthRequest's second parameter to be an array, and
another part requires it to be a scalar! I know that can't be so, but
I don't see what it wants. Again, I'm stymied by the lack of API

Reply via email to