Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function postToTwitter($username,$password,$message){
- $host = "http://twitter.com/statuses/update.xml?status=";
- $host.=urlencode(stripslashes(urldecode($message)));
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $host);
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
- curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
- curl_setopt($ch, CURLOPT_POST, 1);
- $result = curl_exec ($ch) or die('error');
- $resultArray = curl_getinfo($ch);
- curl_close($ch);
- }
Advertisement
Add Comment
Please, Sign In to add comment