News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Doug Brown's Blog:
Use PHP to Twitter Your Tweets
January 13, 2009 @ 07:57:34

Doug Brown has posted a quick tutorial showing how to use the cURL extension in PHP to send tweets off to the Twitter API.

I recently got an email from a reader asking me if I could help them with a small script to post updates to a Twitter account using PHP. I figured this might be something that a few others might be interested in, so I decided to post about it.

His script opens a connection to the "twitter.com/statuses/update.xml" file and posts the username, password and contents of the tweet. If it returns a 200 code (the HTTP "Success" code), then all is well and it was posted. Of course, this simple script is just a start - he recommends other things to add like more input validation, making it into a class rather than procedural and adding in some Javascript to check the length of the tweet.

0 comments voice your opinion now!
twitter tweet curl extension tutorial javascript input validate oop


blog comments powered by Disqus

Similar Posts

Android Hive: Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL

Cormac's Blog: Fast server-side rejection of large image uploads using $_FILES

Hasin Hayder's Blog: My book on OOP-PHP5 has been published

Gary Hokin: An Introduction to Zend Framework 2 for the Zend Framework 1 Developer - Part 1

Stefan Mischook's Blog: Classes and Objects in PHP


Community Events

Don't see your event here?
Let us know!


podcast example api laravel series symfony php7 part2 project yii2 list introduction community interview framework testing opinion composer language application

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework