Y
Y
Yogaphone2019-07-28 02:21:38
In contact with
Yogaphone, 2019-07-28 02:21:38

How to make the birthday change in the VK profile every day?

I want the date of birth to change to the current date at 00:00. Is it possible to do this through the API?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kozlov, 2019-07-28
@Yogaphone

Yes, you can account.saveProfileInfo . You put the script on cron so that it runs at 00:00.

The script itself
<?php
// КОНФИГ
$you_token = 'ТОКЕН'; // Можно получить по ссылке: https://oauth.vk.com/authorize?client_id=3116505&scope=1073737727&redirect_uri=https://api.vk.com/blank.html&display=page&response_type=token&revoke=1
$you_year = 'ВАШ ГОД РОЖДЕНИЯ'
// КОД
$a_date = date('d.m');
$request_params = array(
'bdate' => $a_date.'.'.$you_year,
'v' => '5.52',
'access_token' => $you_token
);
$get_params = http_build_query($request_params);
$result = file_get_contents('https://api.vk.com/method/account.saveProfileInfo?'. $get_params);
echo($result);
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question