kojp
V2EX  ›  问与答

为什么我用weibo的php sdk就这么费劲呢。

  •  
  •   kojp · Aug 8, 2012 · 2871 views
    This topic created in 5064 days ago, the information mentioned may be changed or developed.
    显然,说明文档已经很详细了。可我还是不能顺利走下来。
    用JS的sdk吧。callback函数调用不起来。
    用php的sdk吧。又不能顺利获取到用户信息
    Fatal error: Class 'WeiboClient' not callback.php on line 35

    //根据用户ID获取用户资料(授权用户)
    $c = new WeiboClient( WB_AKEY , //line 35 is here
    WB_SKEY ,
    $_SESSION['last_key']['oauth_token'] ,
    $_SESSION['last_key']['oauth_token_secret'] );
    //用户ID
    $u_id = "u_id";
    $msg = $c->show_user($u_id);
    if ($msg === false || $msg === null){
    echo "Error occured";
    return false;
    }
    if (isset($msg['error_code']) && isset($msg['error'])){
    echo ('Error_code: '.$msg['error_code'].'; Error: '.$msg['error'] );
    return false;
    }
    echo($msg['id'].' : '.$msg['name'].' '.$msg['created_at']);

    代码都是官方的示例代码呀。求解~~
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1307 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 16:52 · PVG 00:52 · LAX 09:52 · JFK 12:52
    ♥ Do have faith in what you're doing.