06-19-2009, 04:45 PM
how do i add X-Twitter-Client to h.post?
X-Twitter-Client: QuickMacros
X-Twitter-Client-Url: Twitter
X-Twitter-Client-Version: 0.1
this does not work:
h.Post("statuses/update.xml" status 0 _s.from("Authorization: Basic " user " ,X-Twitter-Client:QuickMacros"))
example php curl code (pasted to qm to get colored code :mrgreen: )
$headers = array("X-Twitter-Client" => "Auto Tweet", "X-Twitter-
Client-Version" => "1.1", "X-Twitter-Client-URL" => "http://
feastofcrumbs.com/downloads/wp-plugins/auto-tweet/auto-tweet.xml");
$curl_handle = curl_init();
curl_setopt($curl_handle,CURLOPT_URL,"$twitter_rest");
curl_setopt($curl_handle,CURLOPT_HTTPHEADER,$headers);
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=$content");
curl_setopt($curl_handle,CURLOPT_USERPWD,"$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
X-Twitter-Client: QuickMacros
X-Twitter-Client-Url: Twitter
X-Twitter-Client-Version: 0.1
this does not work:
h.Post("statuses/update.xml" status 0 _s.from("Authorization: Basic " user " ,X-Twitter-Client:QuickMacros"))
example php curl code (pasted to qm to get colored code :mrgreen: )
$headers = array("X-Twitter-Client" => "Auto Tweet", "X-Twitter-
Client-Version" => "1.1", "X-Twitter-Client-URL" => "http://
feastofcrumbs.com/downloads/wp-plugins/auto-tweet/auto-tweet.xml");
$curl_handle = curl_init();
curl_setopt($curl_handle,CURLOPT_URL,"$twitter_rest");
curl_setopt($curl_handle,CURLOPT_HTTPHEADER,$headers);
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=$content");
curl_setopt($curl_handle,CURLOPT_USERPWD,"$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
