+ -
当前位置:首页 → 问答吧 → 网易微薄api 应用求助!!

网易微薄api 应用求助!!

时间:2010-09-27

来源:互联网

<?php
session_start();
// Set the default timezone since many servers won't have this configured
date_default_timezone_set('America/Los_Angeles');

// Report everything, better to have stuff break here than in production
ini_set('error_reporting', E_ALL | E_STRICT);

// Add the osapi directory to the include path
set_include_path(get_include_path() . PATH_SEPARATOR . '..');

// Require the osapi library
require_once "../osapi/osapi.php";
//本地登录用户 viewId 由服务端传入
//if (isset($_REQUEST["viewId"])) {
 // $userId = $_REQUEST["viewId"];
 // $_SESSION['viewId']=$userId;   
// } else {
 // $userId=$_SESSION['viewId'];   
//}
//注册应用的apiKey
$apiKey='6a9b10b318524232aaaa120cda2e8ecb';
//注册应用的secretKey
$secretKey='73a3bb6d24384b19b946a17f5a595537';
$userId = "1014001";
$token='iMFMygZzl3xvobVpbjG5lExNJMrr7_Y6vFy7MTlfCZvii7qwvgKq09H_xwV0yEl8bDpzKNRxkdHnoka81d976ce8154d43a2b4167243d0697flej8aS4CsnvdWy4VJ211svw';
$osapi = false;
$strictMode = true;
//网易开发者平台接口地址
$requestUrl='http://rest.netease.com/oauth/request_token';
$authorizeUrl='http://rest.netease.com/oauth/authorize';
$accessUrl='http://rest.netease.com/oauth/access_token';
$restUrl='http://rest.netease.com/social/rest';

// Create an identifier for the local user's session
$localUserId = session_id();

// Select the appropriate test and initialize
$osapi = new osapi(new osapiNeteaseProvider($requestUrl, $authorizeUrl,$accessUrl,$restUrl), new osapiOAuth2Legged($apiKey,$secretKey, $userId,$token));
if (!$osapi)
    throw new Exception("osapi is null");
if ($strictMode)
    $osapi->setStrictMode($strictMode);





这是__init__.php内容!怎么配置才能使用。consumer key与consumer secret.怎么通过邮箱申请?:?
图片:未命名.jpg
'700')this.width='700';if(this.offsetHeight>'700')this.height='700';" title="Click Here To EnLarge">

作者: 240518333   发布时间: 2010-09-27

为什么不先看看网易开放平台的文档。PHPChina上问的sina围脖的api的callback。。光顾着不停的问。自己看过么。。。

自己看看appkey跟secretkey是什么东西

作者: cain   发布时间: 2010-09-27

相关阅读 更多