Here is a simple PHP script that will post updates to a single account using
OAuth: https://gist.github.com/592098
Abraham
-
Abraham Williams | Hacker Advocate | abrah.am
@abraham https://twitter.com/abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.
On Wed, Jan 5, 2011 at 04:22, Muzafar Shah shah@gmail.com wrote:
Greetings,
i want to use twitter API for update status from my website. i don't
want that i should be authenticated everytime whenever i am posting
status from my website. i am using the basic authenticates which just
need username and password and its gives me the following error,
Could not post your Tweet to Twitter.
and the http code: 401.
i am using this:
$username = ($_POST['t_user']);
$password = ($_POST['t_pass']);
$message = ($_POST['t_update']);
$url = 'http://twitter.com/statuses/update.xml';
$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);
curl_setopt($curl_handle, CURLOPT_USERPWD, $username:$password);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
please lead me, i really need your help.
thanks.
--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker:
http://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
http://groups.google.com/group/twitter-development-talk
--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
http://groups.google.com/group/twitter-development-talk