php curl sina微博话题

首页 | 新闻 | 交流 | 问吧 | 文档 | 手册 | 下载 | 博客

php curl sina微博话题

作者:  时间: 2011-05-13

<?
	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);
?>