예제 #1
0
파일: QQ.php 프로젝트: dalinhuang/andyou
 /**
  * 获取腾讯微博粉丝列表
  * 具体接口: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;
 }
예제 #2
0
<?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 "获取失败,请开启调试查看原因";
}