Created
December 18, 2017 22:24
-
-
Save avtehnik/14dc9ffa3338d3b5c2f47c3706d58994 to your computer and use it in GitHub Desktop.
vk request example
This file contains hidden or 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 | |
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