seregazhuk / php-pinterest-bot

This PHP library will help you to work with your Pinterest account without using any API account credentials.
MIT License
416 stars 129 forks source link

Can you please help me to use the edit command ? #520

Open gonjumixproject opened 4 years ago

gonjumixproject commented 4 years ago

Hi all,

I am trying to edit the pins inside of a specific board, however my script partially works..

Sometimes it edits 10 pins, sometimes it edits 1 pin. It does not edit repins at all...

Can you please help me on this ?

if($_POST){ $newLink = $_POST['link']; $board = $boards[$_POST['board']];

$boardId = $board['id'];
$boardPinCount = $board['pin_count'];

$pins = Array();

foreach ($bot->boards->pins($boardId, $boardPinCount) as $pin) {
array_push($pins, $pin);
}
foreach ($pins as $pin) {
    $desc = $pin['description'];
    $link = $newLink;
    $bot->pins->edit($pin['id'], $desc, $link);
    echo $pin['id'];
    echo '<br>';
    echo $pin['description'];
    echo '<br>';

}

Thank you..