Skip to content

Instantly share code, notes, and snippets.

@avtehnik
Created December 18, 2017 22:24
Show Gist options
  • Save avtehnik/14dc9ffa3338d3b5c2f47c3706d58994 to your computer and use it in GitHub Desktop.
Save avtehnik/14dc9ffa3338d3b5c2f47c3706d58994 to your computer and use it in GitHub Desktop.
vk request example
<?php
require_once './vendor/autoload.php';
$auth = getjump\Vk\Auth::getInstance();
$auth->setAppId('____')->setScope('SCOPE')->setSecret('____')->setRedirectUri('http://____');
$token = $auth->startCallback();
$vk = getjump\Vk\Core::getInstance()->apiVersion('5.5')->setToken($token);
$offset = 1;
$count = 100;
while ($count){
$vk->request('wall.get', ['domain' => 'ck_live', "offset" => $offset])->each(function($i, $v) {
if(is_object($v)){
echo $v->date.PHP_EOL;
echo $v->text.PHP_EOL;
}
});
$offset=$offset+100;
$count--;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment