3 // Send a message to Twitter. Returns boolean for success or failure.
4 function wp_ozh_yourls_tweet_it($username, $password, $message){
6 $host = "http://twitter.com/statuses/update.xml?status=".urlencode(stripslashes(urldecode($message)));
9 curl_setopt($ch, CURLOPT_URL, $host);
10 curl_setopt($ch, CURLOPT_VERBOSE, 1);
11 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
12 curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
13 curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
14 curl_setopt($ch, CURLOPT_POST, 1);
17 $result = curl_exec($ch);
18 // Look at the returned header
19 $resultArray = curl_getinfo($ch);
24 //echo "http code: ".$resultArray['http_code']."<br />";
25 return ($resultArray['http_code'] == "200");
30 function wp_ozh_yourls_tweet_log($username, $password, $message) {
31 $f = fopen('/DONNEES/I07143/MES_DOCUMENTS/utils/xampp/xampp/htdocs/wordpress/wp-content/plugins/ozh-plc-bridge/tweet.log', 'a');
32 fputs($f, "$username: $message\n");