/** * 获取腾讯微博粉丝列表 * 具体接口:http://wiki.open.qq.com/wiki/website/get_fanslist * */ public static function getWeiboFansList($paramArr) { $options = array('openId' => '', 'accessToken' => '', 'num' => 30, 'offset' => 0, 'debug' => false); if (is_array($paramArr)) { $options = array_merge($options, $paramArr); } extract($options); $obj = new QC(self::$_APPID, $accessToken, $openId, $debug); $info = $obj->get_fanslist(array("reqnum" => $num, "startindex" => $offset)); if ($info) { //字符转码 array_walk_recursive($info, "api_json_convert_encoding_u2g"); } return $info; }
<?php /* *调用接口代码 * **/ require_once "../API/qqConnectAPI.php"; $qc = new QC(); $setting = array("reqnum" => 10, "startindex" => 0); $ret = $qc->get_fanslist($setting); // show result if ($ret['ret'] == 0) { echo "<meta charset='utf-8' />"; require_once "get_fanslist.html"; } else { echo "<meta charset='utf-8' />"; echo "获取失败,请开启调试查看原因"; }