php curl sina微博话题

<?
        define("APPKEY","");
        define("WEIBOUSERNAME","");
        define("WEIBOPASSWORD","");
        define("TRENDNAME","易试买");
        ini_set('default_charset','utf-8');
        $ci = curl_init();
        curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
        curl_setopt($ci, CURLOPT_URL, "http://api.t.sina.com.cn/trends/statuses.json?source=".APPKEY );
        curl_setopt($ci, CURLOPT_USERPWD, WEIBOUSERNAME.":".WEIBOPASSWORD);
        curl_setopt($ch,CURLOPT_POST,1);
        curl_setopt($ci, CURLOPT_POSTFIELDS, "trend_name=".TRENDNAME);
        $response = curl_exec($ci);
        curl_close ($ci);
        print_r($response);
?>

作者: alex hu   发布时间: 2011-05-13