Hi there,

   I don't see an issue with the code, and as you said it works for
one user and not another. Can you tell me what users it does and does
not work for? A few other things you can try:

 1. Change the password of the user it's not working for and trying
with the new password
 2. Setting curl_setopt($ch, CURLOPT_VERBOSE, 1) and send the standard
error output from your script (probably in the Apache error log,
unless you run from the command line)
    » If you provide that info please be sure to obscure the
'Authorization' header so we don't all know your password.

Thanks;
  — Matt

On Apr 20, 2:28 am, Adrian <spiritpo...@gmail.com> wrote:
> PHP code used:
>
> Hence the error message given is "could not authenticate" -$response
>
> while( $message = array_pop($messages) ){
> $ch = curl_init('http://twitter.com/statuses/update.xml');
>         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
>         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>         curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, 'status='.urlencode($message));
>         curl_setopt($ch, CURLOPT_USERPWD, $settings['twitter-username'].':'.
> $settings['twitter-password']);
>         $response = curl_exec($ch);
>         $resp = curl_getinfo($ch, CURLINFO_HTTP_CODE);
>         curl_close($ch);
>         echo  '<br>posted '.urlencode($message).'<br>';
>         if ( $resp != '200' )
>                 die('Problem with twitter. We should try later. Twitter 
> reported: '.
> $response);
>         else
>                 sleep(5);//Sleep 5 seconds before the next update
>
> }
>
> On Apr 20, 11:48 am, Abraham Williams <4bra...@gmail.com> wrote:
>
> > It would be helpful if you provided code and more details.
>
> > On Mon, Apr 20, 2009 at 02:14, Adrian <spiritpo...@gmail.com> wrote:
>
> > > Also, for the account that works, if I changes its screen name to the
> > > account that doesn't work well, that working account stops working
> > > properly.
>
> > > On Apr 20, 10:12 am, Adrian <spiritpo...@gmail.com> wrote:
> > > > I have a php script that posts updates tohttp://
> > > twitter.com/statuses/update.xml
>
> > > > It works reliably when posting to one account of mine, but when
> > > > switching to another, it constantly says "Problem with Twitter. Could
> > > > not authenticate you. Try again later."
>
> > > > I try again later, multiple times, and only sometimes it will actually
> > > > work. With the other account it always works, so there's something up
> > > > with Twitter and some accounts for such updating.
>
> > --
> > Abraham Williams |http://the.hackerconundrum.com
> > Hacker |http://abrah.am|http://twitter.com/abraham
> > Web608 | Community Evangelist |http://web608.org
> > This email is: [ ] blogable [x] ask first [ ] private.

Reply via email to