So, I'm still having trouble.  I have the following code (cribbed from
a tutorial) which is very simple and should work but does not:

========Start of Code ============
<?php
$twitter_api_url = "http://twitter.com/statuses/update.xml";;
$twitter_data = "status=Updating the API CAlls";
$twitter_user = "[username]";
$twitter_password = "[password]";

$ch = curl_init($twitter_api_url);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $twitter_data);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "{$twitter_user}:
{$twitter_password}");

$twitter_data = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpcode == 200) {
echo "Congratulations,  Tweet was posted correctly.";
}else{
echo "Something went wrong, and the tweet wasn't posted.";
}

?>
=========End of Code =========

Can anyone tell me what I'm doing wrong? (I have changed the username
and password values for this post, normally, they are correct.

Thanks


On Sep 4, 5:44 pm, Peter Denton <petermden...@gmail.com> wrote:
> It may be that "posts" were changed to "gets".
>
> On Sep 4, 2009, at 2:21 PM, Sean Fawcett <s...@fawcettassociates.com>  
> wrote:
>
>
>
>
>
> > Hi:
>
> > A couple of months ago, I received an email from Twitter about some
> > changes in the API.  I was, at that time, up to my eyeballs with a
> > time sensitive project and did not have time to follow up.
>
> > Now, I notice that a very simple function that I created, allowing a
> > user to fill in a text field from a web page and post a Tweet, no
> > longer works.
>
> > Is there something I missed?  What do I need to do to make sure my old
> > code (March '09) now works with the API changes.
>
> > Any insight would be very helpful.
> > Thanks
>
> > Sean

Reply via email to