Here is a complete cURL example of posting to twitter.

//username and password credentials
$username = 'myusername';
$password = 'mypassword';

// The message you want to send
$message = "look world, i am posting to twitter";

//the source parameter provided by twitter
$appSource = 'twibs';

// The twitter API address
$url = 'http://twitter.com/statuses/update.xml';

// Set up and execute the curl process
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "$url");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS,
"status=$message&source=$appSource");

//pass in your login crdentials
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");

//execute your curl
$buffer = curl_exec($curl_handle);

//close curl
curl_close($curl_handle);

On Tue, Feb 10, 2009 at 7:56 PM, SamSoftware <[email protected]> wrote:

>
>
>
> On Feb 10, 9:59 pm, Cameron Kaiser <[email protected]> wrote:
> > >    curlhttp://invalid/xyz=pdq&source=yoursource
> >
> > Er,
> >
> >         curlhttp://invalid/something.json?xyz=pdq&source=yoursource
> >
>
> Ok thanks, what do the xyz and pdq stand for in that url?
>

Reply via email to