Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Vkontakte API class
class Vkapi {
protected static $_client_id = 0;
protected static $_access_token = '%access_token%';
public static function invoke ($name, array $params = array())
$params['access_token'] = self::$_access_token;
$content = file_get_contents(''.$name.'?'.http_build_query($params));
$result = json_decode($content);
return $result->response;
public static function auth (array $scopes)
header('Content-type: text/html; charset=windows-1251');
echo file_get_contents(''.http_build_query(array(
'client_id' => self::$_client_id,
'scope' => implode(',', $scopes),
'redirect_uri' => '',
'display' => 'page',
'response_type' => 'token'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.