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?