Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 17th, 2012  |  syntax: None  |  size: 0.74 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.         define('NICKNAME', 'abc');
  3.         define('PASSWORD', 'iamabc');
  4.         define('USER_ID', '123456');
  5.        
  6.         $message = 'Hello World!';
  7.        
  8.         $ch = curl_init();
  9.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10.         curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  11.         curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  12.        
  13.         // login
  14.         curl_setopt($ch, CURLOPT_URL, 'http://www.plurk.com/Users/login');
  15.         curl_setopt($ch, CURLOPT_POSTFIELDS, 'nick_name='.NICKNAME.'&password='.PASSWORD);
  16.         curl_exec($ch);
  17.        
  18.         // post
  19.         curl_setopt($ch, CURLOPT_URL, 'http://www.plurk.com/TimeLine/addPlurk');
  20.         curl_setopt($ch, CURLOPT_POSTFIELDS, 'qualifier=says&content='.urlencode($message).'&lang=tr_ch&no_comments=0&uid='.USER_ID);
  21.         curl_exec($ch);
  22.        
  23.         curl_close($ch);
  24. ?>