PHP code example of aweitian / sns-connect

1. Go to this page and download the library: Download aweitian/sns-connect library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aweitian / sns-connect example snippets

 php
$config = array(
    'access_token' => '',
    'openid' => '',
    'appid' => $app_id,
    'appkey' => $app_key,
    'callback' => 'http://auth.example.com/login/qq',
    'scope' => 'get_user_info,add_share,list_album,add_album,upload_pic,add_topic,add_one_blog,add_weibo,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idolist,add_idol,del_idol,get_tenpay_addr',
    'errorReport' => true
);
$qc = new Aw\SnsConnect\QQ\QC($config);
header("location:{$qc->qq_login()}");
 php

$config = array(
    'access_token' => '',
    'openid' => '',
    'appid' => $app_id,
    'appkey' => $app_key,
    'callback' => 'http://auth.example.com/login/qq',
    'scope' => 'get_user_info,add_share,list_album,add_album,upload_pic,add_topic,add_one_blog,add_weibo,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idolist,add_idol,del_idol,get_tenpay_addr',
    'errorReport' => true
);
$qc = new Aw\SnsConnect\QQ\QC($config);
$config['access_token'] = $qc->qq_callback();
$config['openid'] = $qc->get_openid();
//var_dump($config);
$qc = new Aw\SnsConnect\QQ\QC($config);
$info = $qc->get_user_info();
var_dump($info);