Hi there,
If this is an OAuth application you'll probably find it easiest
to checkout some of the previous examples and libraries [1]. If this
is a non-OAuth application you need to add a source parameter, like:
curl_setopt($curl, CURLOPT_POSTFIELDS, "source=$source_name&status=
$status");
Thanks;
– Matt Sanford / @mzsanford
Twitter Dev
[1] -http://bit.ly/g_oauth_php
On Jun 3, 2009, at 4:50 AM, Niju Mohan C P wrote:
Hello all,
I use php with curl to post tweets.
If my app is registered at twitter how can i specify the source.
The following is the code i'm using...
$tweetUrl = 'http://www.twitter.com/statuses/update.xml';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "$tweetUrl");
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "status=$status");
curl_setopt($curl, CURLOPT_USERPWD, "$twitterUsername:
$twitterPassword");
$result = curl_exec($curl);
$resultArray = curl_getinfo($curl);