Created
September 26, 2009 17:27
-
-
Save ritou/194324 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 0. phpのインクルードパスをごにょごにょするコードを追記 | |
$path_extra = dirname(__FILE__); | |
$path = ini_get('include_path'); | |
$path = $path_extra . PATH_SEPARATOR . $path; | |
ini_set('include_path', $path); | |
// 1.Include OAuth library. | |
require('lib/YahooOAuth.inc'); | |
// 2.Consumer Key & Secret | |
$consumerKey = ''; | |
$consumerSecret = ''; | |
// 3.callback URL | |
$callback = sprintf('http://%s%s',$_SERVER['SERVER_NAME'],$_SERVER['SCRIPT_NAME']); | |
// 4.sessionを取得 | |
$session = YahooSession::requireSession($consumerKey, $consumerSecret, $callback); | |
// 結果表示 | |
header('Content-Type: text/html; charset=utf-8'); | |
?> | |
<html> | |
<head> | |
<title>GUID確認・サンプルコード</title> | |
</head> | |
<body> | |
<h1>OAuthにより認可されたユーザーのGUID</h1> | |
<pre><?php print $session->getGuid(); ?></pre> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment