PHP code example of aislandener / pinterest-laravel

1. Go to this page and download the library: Download aislandener/pinterest-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aislandener / pinterest-laravel example snippets


'providers' => [
    [...] // other service providers
    \WaleedAhmad\Pinterest\ServiceProviders\PinterestServiceProvider::class,
]

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

if(isset($_GET["code"])){
    $token = Pinterest::auth()->getOAuthToken($_GET["code"]);
    Pinterest::auth()->setOAuthToken($token->access_token);
}

$me = Pinterest::user()->me();
echo $me;

Pinterest::user()->me();

Pinterest::user()->me(array(
    'fields' => 'username,first_name,last_name,image[small,large]'
));

$pins = Pinterest::user()->getMePins();
$pins->all();

$pins = Pinterest::user()->getMePins();
$pins->get(0);

$pins = Pinterest::user()->getMePins();
$pins->hasNextPage();

Pinterest::auth()->getLoginUrl("https://pinterest.dev/callback.php", array("read_public"));

Pinterest::auth()->getOAuthToken($code);

Pinterest::auth()->setOAuthToken($access_token);

Pinterest::auth()->getState();

Pinterest::auth()->setState($state);

Pinterest::getRateLimit();

Pinterest::getRateLimitRemaining();

Pinterest::user()->me();

Pinterest::user()->find('waleedahmad');

Pinterest::user()->getMePins();

Pinterest::user()->searchMePins("cats");

Pinterest::user()->searchMeBoards("cats");

Pinterest::user()->getMeBoards();

Pinterest::user()->getMeFollowers();

Pinterest::boards()->get("waleedahmad/pinterest-laravel");

Pinterest::boards()->create(array(
    "name"          => "Test board from API",
    "description"   => "Test Board From API Test"
));

Pinterest::boards-edit("waleedahmad/pinterest-laravel", array(
    "name"  => "Test board after edit"
));

Pinterest::boards()->delete("waleedahmad/pinterest-laravel");

Pinterest::pins()->get("181692166190246650");

Pinterest::pins()->fromBoard("waleedahmad/pinterest-laravel");

Pinterest::pins()->create(array(
    "note"          => "Test board from API",
    "image_url"     => "https://download.unsplash.com/photo-1438216983993-cdcd7dea84ce",
    "board"         => "waleedahmad/pinterest-laravel"
));

Pinterest::pins()->create(array(
    "note"          => "Test board from API",
    "image"         => "/path/to/image.png",
    "board"         => "waleedahmad/pinterest-laravel"
));

Pinterest::pins()->create(array(
    "note"          => "Test board from API",
    "image_base64"  => "[base64 encoded image]",
    "board"         => "waleedahmad/pinterest-laravel"
));

Pinterest::pins()->edit("181692166190246650", array(
    "note"  => "Updated name"
));

Pinterest::pins()->delete("181692166190246650");

Pinterest::following()->users();

Pinterest::following()->boards();

Pinterest::following()->interests();

Pinterest::following()->followUser("waleedahmad");

Pinterest::following()->unfollowUser("waleedahmad");

Pinterest::following()->followBoard("503066289565421201");

Pinterest::following()->unfollowBoard("503066289565421201");

Pinterest::following()->followInterest("architecten-911112299766");

Pinterest::following()->unfollowInterest("architecten-911112299766");
$xslt
php artisan vendor:publish --provider="WaleedAhmad\Pinterest\ServiceProviders\PinterestServiceProvider"