這邊有個自動發plurk的範例程式碼:
http://gist.github.com/53380
<?phpdefine('NICKNAME', 'abc');define('PASSWORD', 'iamabc');define('USER_ID', '123456');$message = 'Hello World!';$ch = curl_init();curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');// logincurl_setopt($ch, CURLOPT_URL, 'http://www.plurk.com/Users/login');curl_setopt($ch, CURLOPT_POSTFIELDS, 'nick_name='.NICKNAME.'&password='.PASSWORD);curl_exec($ch);// postcurl_setopt($ch, CURLOPT_URL, 'http://www.plurk.com/TimeLine/addPlurk');curl_setopt($ch, CURLOPT_POSTFIELDS, 'qualifier=says&content='.urlencode($message).'&lang=tr_ch&no_comments=0&uid='.USER_ID);curl_exec($ch);curl_close($ch);?>
沒有留言:
張貼留言