网易微薄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.怎么通过邮箱申请?:?
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">
'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是什么东西
自己看看appkey跟secretkey是什么东西
作者: cain 发布时间: 2010-09-27
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28