Posting to Twitter Using the load() Function for PHP

Due to the super simple API that's provided by twitter, its very easy to post to Twitter. And thats made even simpler by using the load() function. As simple as this...


$status = urlencode("Your new Twitter status goes here...");
$username = "binnyva";
$password = "not_going_to_tell_you";
$twitter_response = load("http://$username:$password@twitter.com/statuses/update.json?status=$status", array('method'=>'post'));
// Returns JSON data - if you want to do anything with it.

This what I used to create the BSE Sensex twitter bot.

Comments

Tass at 04 Jan, 2010 11:44
Hi

I saw your code,fine But can we tweet without twitter password , only use user name ?

if u have time reply me

Thanks
Reply to this.
Binny V A at 05 Jan, 2010 12:54
You'll have to have the password. Otherwise, its just poor security.
Reply to this.
Ruchan at 23 Feb, 2010 02:04
If my understanding id correct your script does basic authentication not OAuth. And OAuth will be mandatory in 5 months. Any chance for Oauth?
Reply to this.
Comment

Please dont enter you comments in this form - this is a fake form to confuse spamming bots. The next form is the real one.




Comment




Comment Formating : HTML tags a, strong, em, b, i, code, pre, p and br allowed. Other tags will be shown as code(< will become &lt;). Urls, Line breaks will be auto-formated.
Subscribe to Feed