T
T
Timofey Alekseev2019-05-17 10:24:39
PHP
Timofey Alekseev, 2019-05-17 10:24:39

Why doesn't wall.post stop working?

There is a code that takes a list of photos in an album and posts a random one on the wall. But the script does not stop and fasts many photos at once with an interval of about a minute. What's wrong?

<?php
$fpt = file_get_contents('https://api.vk.com/method/photos.get?owner_id=-1766&album_id=2629&count=1000&access_token=***&v=5.50');
$jjs = json_decode($fpt);
$jrnd = $jjs->response->count;
$jrnd = rand('0',$jrnd);
$pid = $jjs->response->items[$jrnd]->id;
file_get_contents('https://api.vk.com/method/wall.post?owner_id=-182&access_token=***&v=5.50&from_group=1&attachment=photo-1766_'.$pid);
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Infinite Jackal, 2019-05-19
@infjackal

And you try at the end, when the script is executed, clear the variables. Maybe it will help, but I can't promise.

$fpt->free(); /*пример очистки переменной. способов много, но я пользуюсь им и всё работает.*/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question