<?php
/* versionbeta:name
 * versionbeta:number
 * versionbeta:site
 * versionbeta:pubtime
 */
include "inc.php";
$url = "https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=100315954&client_secret=52b704ad77f16881d4ccee912a6b44b6&code=" . $_GET["code"] . "&redirect_uri=http%3a%2f%2fwww.bawangfan.com%2fqqlogin.php&state=";
$cont = file_get_contents($url);
$arr = explode("&",$cont);
$access_token = "";
foreach($arr as $item) {
	$a = explode("=",$item);
	if(count($a)!=2) continue;
	if($a[0] == 'access_token') {
		$access_token = $a[1];
	}
}
$url = "https://graph.qq.com/oauth2.0/me?access_token=" . $access_token;
$cont = file_get_contents($url);
echo $cont;
?>