我无法理解Pinterest-API-PHP的逻辑

I need to write a script for automatically posting pins from my local LAMP server to my Pinterest account.

require 'vendor/autoload.php'; // include Composer's autoloader

use DirkGroenen\Pinterest\Pinterest;

$pinterest=new Pinterest('*my client id*','*my*app*secret*');

$loginurl=$pinterest->auth->getLoginUrl('https://127.0.0.1', array('read_public'));
echo '<a href=' . $loginurl . '>Authorize Pinterest</a>';

I thought I need to authorize to make some actions such as making pins but the authorization method does not work without REDIRECT_URI. I do not need to have any redirect. I just planned to insert a code below that will created pins.

What steps should I perform to post a pin by PHP script? Should I use redirect to another PHP script which will perform actions what I want? What steps should I perform to post a pin by PHP script?

Pinterest uses OAuth 2.0 to authenticate requests between your app and your users.

$loginurl var contain URL, for authorization, you need to click to this URL and authorize, after that you will be able to post

You can't do it automatically without authorization, and you need redirect_url where Pinterest would be send the token