Advertisement
alexx876

Untitled

Dec 17th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. function randomAPITask($token) {
  2.     //Случайный метод API
  3.     $data = [
  4.         'https://api.vk.com/method/newsfeed.get',
  5.         'https://api.vk.com/method/docs.get',
  6.         'https://api.vk.com/method/groups.get',
  7.         'https://api.vk.com/method/friends.get',
  8.     ];
  9.    
  10.     //Параметры для этого метода
  11.     $params = [
  12.         ['filters' => 'post,photo,photo_tag, wall_photo'],
  13.         ['count' => '20'],
  14.         ['extended' => 1],
  15.         ['order' => 'name']
  16.     ];
  17.    
  18.     //Выбираем метод
  19.     $rand = rand(0, count($data)-1);
  20.    
  21.     //Апи ключ и версия
  22.     $params[$rand]['access_token'] = $token;
  23.     $params[$rand]['v'] = '5.80';
  24.    
  25.     return $data[$rand].'?'.http_build_query($params[$rand]);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement