<?
///***Developed by invisible ICQ: 7773296 ***///
///Настройки скрипта
$tok = '00000000000000000000000000000000000'; ///Токен
$myid = '0000000'; ///Мой ID
$myidgr = '0000000'; ///ID или домен группы - паблика
$imga = 'http://milylibka.ru/wp-content/gallery/svidaniya/azov_tandem_yo.jpg'; ///Картинка для постинга
///Получаем разрешение на загрузку картинки Вконтакте
$dl = file_get_contents("https://api.vk.com/method/photos.getWallUploadServer?group_id=$myidgr&access_token=$tok");
$dl = json_decode($dl); ///Декодируем json
$dl = $dl->response->upload_url; ///Получаем ссылку загрузки от Вконтакте
$file = new CURLFile(realpath("$imga")); ///Загружаем картинку
$ch = curl_init($dl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'photo' => $file
));
$data = curl_exec($ch);
curl_close($ch);
///Получаем данные для сохранения картинки
$fot = $data; ///Получаем данные из массива
$fot = json_decode($data); ///Декодируем json
$fot = $fot->photo; ///Получаем данные из массива
$hash = json_decode($data); ///Декодируем json
$hash = $hash->hash; ///Получаем данные из массива
$serv = json_decode($data); ///Декодируем json
$serv = $serv->server; ///Получаем данные из массива
///Сохраняем фото на сервер Вконтакте
$result = file_get_contents("https://api.vk.com/method/photos.saveWallPhoto?group_id=$myidgr&hash=$hash&server=$serv&photo=$fot&access_token=$tok");
$fok = json_decode($result); ///Декодируем json
$fok = $fok->response->id; ///Получаем данные из массива
///Вырезаем данные из информации после сохранения на сервер (Использовать если не работает переменная $result)
$fok = substr($result, strpos($result,'"id":"')+6, strlen($result)); ///Отрезаем начало до photo
///Создаем сообщение на стену
$result1 = file_get_contents("https://api.vk.com/method/wall.post?owner_id=-$myidgr&attachments=$fok&access_token=$tok"); ///Ставим "-" перед перемнной $myidgr если выкладываем на стену сообщества
///***Developed by invisible ICQ: 7773296 ***///
?>
my_super_function($_FILES);
<Sum> [stat]player_ammo_restored = 425339
<Sum> [stat]player_climb_assists = 17154
<Sum> [stat]player_climb_coops = 9321
<Sum> [stat]player_damage = 489573500
<Sum> [mode]PVE [stat]player_deaths = 22793
<Sum> [mode]PVP [stat]player_deaths = 107455
<Sum> [class]Rifleman [mode]PVP [stat]player_headshots = 38150
<Sum> [class]Medic [mode]PVE [stat]player_headshots = 40388
<Sum> [class]Medic [mode]PVP [stat]player_headshots = 4271
<Sum> [class]Recon [mode]PVE [stat]player_headshots = 129160
<Sum> [class]Recon [mode]PVP [stat]player_headshots = 5423
....
const arr = json.full_response.split('\n');
/*
[0 … 99]
0: "<Sum> [stat]player_ammo_restored = 425339"
1: "<Sum> [stat]player_climb_assists = 17154"
2: "<Sum> [stat]player_climb_coops = 9321"
3: "<Sum> [stat]player_damage = 489573500"
4: "<Sum> [mode]PVE [stat]player_deaths = 22793"
5: "<Sum> [mode]PVP [stat]player_deaths = 107455"
6: "<Sum> [class]Rifleman [mode]PVP [stat]player_headshots = 38150"
7: "<Sum> [class]Medic [mode]PVE [stat]player_headshots = 40388"
8: "<Sum> [class]Medic [mode]PVP [stat]player_headshots = 4271"
9: "<Sum> [class]Recon [mode]PVE [stat]player_headshots = 129160"
10: "<Sum> [class]Recon [mode]PVP [stat]player_headshots = 5423"
11: "<Sum> [class]Engineer [mode]PVE [stat]player_headshots = 137344"
12: "<Sum> [class]Engineer [mode]PVP [stat]player_headshots = 17705"
13: "<Sum> [class]Rifleman [mode]PVE [stat]player_headshots = 429473"
*/
arr.forEach((el) => {
if (el.indexOf('Medic') >= 0) {
window.console.log(el);
}
});
/*
<Sum> [class]Medic [mode]PVE [stat]player_headshots = 40388
<Sum> [class]Medic [mode]PVP [stat]player_headshots = 4271
<Sum> [class]Medic [mode]PVP [stat]player_hits = 286872
<Sum> [class]Medic [mode]PVE [stat]player_hits = 824486
<Sum> [class]Medic [mode]PVE [stat]player_melee_headshots = 133
<Sum> [class]Medic [mode]PVP [stat]player_melee_headshots = 37
<Sum> [class]Medic [mode]PVE [stat]player_playtime = 17714490
<Sum> [class]Medic [mode]PVP [stat]player_playtime = 12876754
*/