GithubHelp home page GithubHelp logo

seregazhuk / php-pinterest-bot Goto Github PK

View Code? Open in Web Editor NEW
414.0 48.0 127.0 2.48 MB

This PHP library will help you to work with your Pinterest account without using any API account credentials.

License: MIT License

PHP 100.00%
pinterest bot pinterest-api

php-pinterest-bot's Introduction

Pinterest Bot for PHP

Pinterest PHP Bot

Build Status Code Climate Scrutinizer Code Quality Test Coverage StyleCI Total Downloads

A PHP library to help you work with your Pinterest account without API credentials.

The Pinterest API is painful: receiving an access token involves registering a developer account, registering an application, then waiting for confirmation. Not to mention, the public API itself is poorly implemented and has a limited set of features.

This library offers the full functionality available on Pinterest's website, with no need to register an application to receive an access token. All that's needed is your account login information (but even this is not required if you don't plan on creating pins, writing comments or sending messages)!

Installation

Dependencies

Library requires CURL extension and PHP 7.0 or above.

The recommended way to install this library is via Composer. New to Composer?

composer require seregazhuk/pinterest-bot

Quick Start

// You may need to amend this path to locate Composer's autoloader
require('vendor/autoload.php'); 

use seregazhuk\PinterestBot\Factories\PinterestBot;

$bot = PinterestBot::create();

// Login
$bot->auth->login('mypinterestlogin', 'mypinterestpassword');

// Get lists of your boards
$boards = $bot->boards->forUser('yourUserName');

// Create a pin
$bot->pins->create('http://exmaple.com/image.jpg', $boards[0]['id'], 'Pin description');

Note: Some methods (e.g. get user followers/following, pins likes/dislikes, search and other feed queries) use Pinterest navigation through results (with bookmarks). This means that for every batch of results, a call is made to Pinterest and a Pagination object with Pinterest API results is returned.

How to avoid ban

To avoid being banned by Pinterest, do not aggressively pin or write comments (e.g. creating hundreds of pins in a single minute). Do this by inserting timeouts (sleep($seconds)) with calls.

Examples

These articles provide examples of common tasks that can be performed with the bot:

How can I thank you?

Why not star this GitHub repo? I'd love the attention! Or, you can donate to my project on PayPal:

Support me with some coffee

Thanks!

php-pinterest-bot's People

Contributors

alexeykosov avatar andreybolonin avatar bercium avatar kitar avatar kiwired avatar lex111 avatar raiyaj avatar saulacher avatar scrutinizer-auto-fixer avatar seregazhuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-pinterest-bot's Issues

Get pin Info not work

Hi seregazhuk,
I tried this code:
$info = $bot->pins->info('393994667383919015');
print_r($info);

and the output is "1". It seems that something wrong. Right? Can you plz check it.

Request: add the feauture: Edit pin

Hi, I wonder if I can make a request here. Can you please support the feature Edit pin for this Bot. The input will be the pinID and other necessary infos to update for that pin. something like:

public function editPin($pinID, $description = "new Description", $link = "new Link")

Thanks in advance,

New Account Creation

I used this library to create a new account with, but I never did receive a confirmation email from Pinterest. Looking at the account, I couldn't see where I was supposed to confirm my email address.

Then, when I started using the library for that account, my account got shut down. Have you experienced this issue (not receiving the confirmation email)? Is there a way to prevent this from happening? I've tested on a Gmail account and an owned domain email account to see if it was Gmail only, but it's not.

boards->forUser() Not returning secret boards.

I have a staging pinterest account (non-business) with 2 public boards, 2 secret boards. On staging, boards->forUser() will successfully grab all 4 boards. On my business Pinterest account, I have 88 public boards and 4 secret boards. Using boards->forUser('userHere',100) with this business account only fetches 88 of the 92 boards. Not sure if the difference in number of boards or difference in type of account (normal vs business) is causing the change in behavior.

Login Failed,

I've tried to use pins create method and I got following error:

AuthException in ProviderLoginCheckWrapper.php line 54: You must log in before.

Yes I have used login function before calling this method and I get return true (as I assume its successfully logged in).

Currently I am using XAMPP

profile image upload not work

Hello sir
just wonder does the profile image still work?
because i try few time, the profile image cant uploaded

thank you

Cann't login and no last error

hi, i can't login using pinterest bot and getLastError returns empty.
can you help me to find out what happened?
`$username = "";
$passwd = "
";
$bot = PinterestBot::create();
// 1. proxy
//$bot->getHttpClient()->useProxy("112.74.133.239", "82");

// 2. Login
$result = $bot->auth->login($username, $passwd);
if (!$result) {
echo "last error:".$bot->getLastError()."\n";
die();
}
if ($bot->user->isBanned()) {
die("Account $username has been banned!\n");
}
//
// Get lists of your boards
$boards = $bot->boards->forUser('user');
var_dump($boards);`

Fatal error: Response.php on line 112

Hello. I'm having a Issue.
can you help me?

This sample code run.
require '../vendor/autoload.php';
use seregazhuk\PinterestBot\Factories\PinterestBot;
$bot = PinterestBot::create();
$result = $bot->auth->login('id', 'pass');
if (!$result) {
echo $bot->getLastError();
die();
}

result:
Fatal error: Can't use method return value in write context in /php-pinterest-bot/src/Api/Response.php on line 112

Login not working anymore

Hello @seregazhuk,

Login is failing now. It's creating the cookie file as follows:

Netscape HTTP Cookie File

http://curl.haxx.se/docs/http-cookies.html

This file was generated by libcurl! Edit at your own risk.

HttpOnly_.pinterest.com TRUE / TRUE 1508412815 _auth 0

HttpOnly_.pinterest.com TRUE / TRUE 1508412815 _pinterest_sess TWc9PSYyT2wvQ1VMMjI1OGo1ZUM0V2hZMkpvRWxrU3A3WlhOR0p0djZSbTF1L0p2eTlvZ1pjeU5JNW9zMm5QSmV6ZUVpYlFtZWx0NUZXMm5yNmlQVlNPbjlRZWZMaWJRcWduZjM0M1kvdWlyTjBxRnNxTFpmbHJoUTUvdVowakVCYVFOdG1FUklFUjNpa1ZjYWV3SnNjb2V1d3c9PSZBc1EyS25kSnU5QzBLZUVlaUVzbFN4ckhQYnM9

I have tried with two accounts, same results. Let me know.
Thanks.

Search not working

user->login('username', 'password',false); if(!$result) { echo $bot->getLastError(); die(); } print_r($bot->pins->search('wedding', 2)); ?>

it returns Generator Object ( )

Issue with unfollow

First of all, thanks very much for the library, everything has been working great for me apart for unfollow functionality. I use it as in the readme:

$bot->pinners->unfollow($userId);

However the user is not being unfollowed. I checked the error and I am getting:

[code] => INVALID_HTTP_METHOD_FOR_RESOURCE_METHOD
[target] => None
[http_status] => 400

Any idea why this could happen?

Thanks a lot!

get pins of a board

i want to get pins of a specified board.
Is this possible i dont see any way for this ?!

How to get a user followed me or not ?

Userinfo function return

Array
(
[impressum_url] =>
[last_name] => Bardhan
[domain_verified] =>
[following_count] => 245
[image_medium_url] => https://s-media-cache-ak0.pinimg.com/avatars/ibardhan_1420212276_75.jpg
[like_count] => 4
[image_xlarge_url] => https://s-media-cache-ak0.pinimg.com/avatars/ibardhan_1420212276_280.jpg
[full_name] => Indrojit Bardhan
[image_small_url] => https://s-media-cache-ak0.pinimg.com/avatars/ibardhan_1420212276_30.jpg
[id] => 544161704884351899
[first_name] => Indrojit
[domain_url] =>
[explicitly_followed_by_me] =>
[location] =>
[indexed] => 1
[is_partner] =>
[type] => user
[image_large_url] => https://s-media-cache-ak0.pinimg.com/avatars/ibardhan_1420212276_140.jpg
[board_count] => 1
[username] => ibardhan
[repins_from] => Array
(
[0] => Array
(
[username] => JBL316
[repins_from] => Array
(
)

                [image_medium_url] => https://s-media-cache-ak0.pinimg.com/avatars/JBL316_1416014134_75.jpg
                [full_name] => jbl
                [image_small_url] => https://s-media-cache-ak0.pinimg.com/avatars/JBL316_1416014134_30.jpg
                [id] => 344314471419780089
            )

    )

[verified_identity] => Array
    (
    )

[twitter_url] => 
[facebook_url] => https://www.facebook.com/indrojit.bardhan.5
[has_showcase] => 
[follower_count] => 0
[pin_count] => 2
[about] => 
[show_impressum] => 
[has_board] => 1
[website_url] => 
[blocked_by_me] => 

)

it is easy to be banned?

it is so easy to be banned by php client, even i only execute few actions. how to hide my bot identity?

register method return false

Hi, great api :)

I am trying to create new profile with register mehtod and I've false any time I try..
Does it actually works?

thank you

Reply

My name is Simon I sent you an email please reply............

Can't register now.

Seem like the $bot->auth->register() does not work anymore.

  • After register , i logged in with that email and password , but i got an error :
    "The email you entered does not belong to any account."

Please check again.

Cookie checher + proxy

Привет!

Сегодня ночью отрубилась прокси с которой я работал, ожидал что в таком случае отработает функция $bot->auth->isLoggedIn() или проверка записи куки. На скорую руку вписал в Cookie 47 строку

        if (file($file) == false) {
            echo "Не получили Cookie, проверить возможность записи в папку или прокси!";
            exit();
        }

Вот что выдает при логине $bot->auth->login($log, $pas);:

Warning: file(C:\Users\Max\AppData\Local\Temp\[email protected]): failed to open stream: No such file or directory in C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Helpers\Cookies.php on line 48

Call Stack:
    0.0630     143336   1. {main}() C:\OpenServer\domains\scripts.loc\www\pinterest\dead_houzz.php:0
    2.2031     959696   2. pinterest_login(???, ???, ???) C:\OpenServer\domains\scripts.loc\www\pinterest\dead_houzz.php:27
    2.2081    1181272   3. seregazhuk\PinterestBot\Api\Providers\ProviderWrapper->login(???, ???) C:\OpenServer\domains\scripts.loc\www\pinterest\dead_houzz.php:126
    2.2081    1181576   4. seregazhuk\PinterestBot\Api\Providers\ProviderWrapper->__call(???, ???) C:\OpenServer\domains\scripts.loc\www\pinterest\dead_houzz.php:126
    2.2081    1181944   5. call_user_func_array:{C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\ProviderWrapper.php:38}(???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\ProviderWrapper.php:38
    2.2081    1182224   6. seregazhuk\PinterestBot\Api\Providers\Auth->login(???, ???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\ProviderWrapper.php:38
    2.2091    1182824   7. seregazhuk\PinterestBot\Api\Providers\Auth->processLogin(???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\Auth.php:42
    2.2091    1203496   8. seregazhuk\PinterestBot\Api\Providers\Provider->execPostRequest(???, ???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\Auth.php:178
    2.2101    1203848   9. seregazhuk\PinterestBot\Api\Providers\Provider->execute(???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\Provider.php:56
    2.2101    1203928  10. seregazhuk\PinterestBot\Api\Request->exec(???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\Provider.php:88
    2.2101    1205304  11. seregazhuk\PinterestBot\Api\CurlHttpClient->execute(???, ???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Request.php:102
    2.2101    1206800  12. seregazhuk\PinterestBot\Api\CurlHttpClient->callCurl() C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\CurlHttpClient.php:89
    2.2291    1206080  13. seregazhuk\PinterestBot\Api\CurlHttpClient->fillCookies() C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\CurlHttpClient.php:103
    2.2291    1206080  14. seregazhuk\PinterestBot\Helpers\Cookies->fill(???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\CurlHttpClient.php:285
    2.2291    1206112  15. file(???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Helpers\Cookies.php:48

И вот что при $bot->auth->isLoggedIn() - phpstorm при добавлении в watch пишет cannot evaluate expression, но при этом в алгоритме

if ($bot->auth->isLoggedIn()) {
//go go code
    } else {

Проходит почему-то как TRUE и выдает:

Warning: Invalid argument supplied for foreach() in C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Helpers\Cookies.php on line 48

Call Stack:
    0.0630     143336   1. {main}() C:\OpenServer\domains\scripts.loc\www\pinterest\dead_houzz.php:0
    2.2031     959696   2. pinterest_login(???, ???, ???) C:\OpenServer\domains\scripts.loc\www\pinterest\dead_houzz.php:27
    2.2081    1181272   3. seregazhuk\PinterestBot\Api\Providers\ProviderWrapper->login(???, ???) C:\OpenServer\domains\scripts.loc\www\pinterest\dead_houzz.php:126
    2.2081    1181576   4. seregazhuk\PinterestBot\Api\Providers\ProviderWrapper->__call(???, ???) C:\OpenServer\domains\scripts.loc\www\pinterest\dead_houzz.php:126
    2.2081    1181944   5. call_user_func_array:{C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\ProviderWrapper.php:38}(???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\ProviderWrapper.php:38
    2.2081    1182224   6. seregazhuk\PinterestBot\Api\Providers\Auth->login(???, ???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\ProviderWrapper.php:38
    2.2091    1182824   7. seregazhuk\PinterestBot\Api\Providers\Auth->processLogin(???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\Auth.php:42
    2.2091    1203496   8. seregazhuk\PinterestBot\Api\Providers\Provider->execPostRequest(???, ???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\Auth.php:178
    2.2101    1203848   9. seregazhuk\PinterestBot\Api\Providers\Provider->execute(???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\Provider.php:56
    2.2101    1203928  10. seregazhuk\PinterestBot\Api\Request->exec(???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Providers\Provider.php:88
    2.2101    1205304  11. seregazhuk\PinterestBot\Api\CurlHttpClient->execute(???, ???, ???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\Request.php:102
    2.2101    1206800  12. seregazhuk\PinterestBot\Api\CurlHttpClient->callCurl() C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\CurlHttpClient.php:89
    2.2291    1206080  13. seregazhuk\PinterestBot\Api\CurlHttpClient->fillCookies() C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\CurlHttpClient.php:103
    2.2291    1206080  14. seregazhuk\PinterestBot\Helpers\Cookies->fill(???) C:\OpenServer\domains\scripts.loc\vendor\seregazhuk\pinterest-bot\src\Api\CurlHttpClient.php:285

Pagination

Is there a way to request different pages? I know we can set a limit for searches and other things, but it'd be nice to set a limit and page. We'd like to be able to get the first 100 results, then the 2nd 100 results is a separate call. Is there any way to do that currently? If not, are there plans to add this in?

Getting error

I fresh installed a server and install Apache, PHP 5.6 on Centos 7.1
I uploaded all file one server in pin folder and created a new.php with sample code.

<?php
use seregazhuk\PinterestBot\PinterestBot;


$bot = new PinterestBot('mypinterestlogin', 'mypinterestpassword');
$bot->login();

$boards = $bot->boards->my();

echo $boards;

Added my details in above code and and accessed new.php file on browser.

http://x.x.x.x/pin/new.php

PHP Fatal error: Class 'seregazhuk\PinterestBot\PinterestBot' not found in /var/www/html/pin/new.php on line 5, referer: http://x.x.x.x/pin/new.php

What's the problem???

Not working

Used this code:

require('vendor/autoload.php'); 
use seregazhuk\PinterestBot\Factories\PinterestBot;

$bot = PinterestBot::create();
$login = $bot->auth->login('login', 'pass'); //return true

$a=$bot->pins->feed(100);
$b=$bot->pins->search('batman',100);

print_r($a); //It returns an array of strange data, which are not similar to the correct data.
print_r($b); //It returns an array of strange data, which are not similar to the correct data.

screenshot_1

Search returning only 25 results

I am using the script as per your readme file to search for pins and whether I write to an array or iterate over the generator object, the maximum I can get is 25.
For example:
$results0 = $bot->pins->search('kitchens', 0)->toArray(); echo count($results0). "<br/>"; //25 $results20 = $bot->pins->search('kitchens', 20)->toArray(); echo count($results20). "<br/>"; //20 $results50 = $bot->pins->search('kitchens', 50)->toArray(); echo count($results50). "<br/>";// 25 $results100 = $bot->pins->search('kitchens', 100)->toArray(); echo count($results100). "<br/>"; //25
I wonder what I'm doing wrong?

Hi

Hi,

I'm new, how to install this bot ?

Thanks.

MultiThreading - мультипоточность.

Привет! Еще раз хочу поблагодарить за столь прекрасный и полезный код который меня выручил )

Подскажите, сложно ли / возможно ли добавить возможность работать мультипоточно через прокси и разные аккаунты? Скорости очень-очень не хватает - даже для API запросов, получается на обработку около 1.5 сек, а когда нужно прошерстить тысячи запросов - уходят часы.

Не стоит ли это в планах разработки, и если да, то возможно вас простимулировать дополнительно $? :)

Также хотелось бы функцию типа random rotate user agent с привязкой к конкретному аккаунту и конкретной проксе под каждый аккаунт.

GREAT CODE

you have great code. It's amazing. Thank you so much!

Как получить список пинов и количество лайков и количество досок для пина с определенного сайта?

Добрый день!

Как с помощью вашего бота получить список пинов по запросу вот такого вида
https://www.pinterest.com/source/giphy.com/

И отсюда нужно получить количество досок для каждого пина с данного сайта, далее некое подобие вот такого запроса который отображает общее количество пинов для данного URL пина https://api.pinterest.com/v1/urls/count.json?&url=http://giphy.com/gifs/colbertlateshow-stephen-colbert-late-show-l44QiBOm1VJ97BOhO

request adding link on each pin

sorry maybe this is not issue but request, is there any possible to add link to every pinner, i mean right now when i do a pin

$bot->pins->create('http://exmaple.com/image.jpg', $boards[0]['id'], 'pin description');

when i try to open the board, and click the image, it goes directly to http://exmaple.com/image.jpg is there any option to add specific link rather than link to the image url, maybe like

$bot->pins->create('http://exmaple.com/image.jpg','http://google.com', $boards[0]['id'], 'pin description');

so when i click the image it goes to google.com

how to use proxy

Hi
bit confuse how to use proxy in this script
for example i want to register - > login -> create board then logout, how should I do to make all that 4 step using proxy, if using standard step maybe i can use just like this (cmiiw) but how when i should use proxy, how to do it?

$bot->auth->register('[email protected]', 'password', 'Name');
$result = $bot->auth->login('mypinterestlogin', 'mypinterestpassword');
$bot->boards->create('name', 'description');
$bot->auth->logout();

thank you

Pins search return empty result

Pins search return empty result.
My code (before it worked):
require_once("vendor/autoload.php"); use seregazhuk\PinterestBot\Factories\PinterestBot; $bot = PinterestBot::create(); var_dump($bot->pins->search("car", 10));

My Result :
object(Generator)#11 (0) { }

Get board followers not work

Hi,

Thank you for your bot. I have tested it and it's really good. But one problem is that the feature to get user following not work. Can you please check. Thanks.

foreach($bot->pinners->following('username') as $followingBatch)
{
// ...
}

Ask for supporting new feature

Dear author,
I must say that your tool is awesome. Could I ask for one more feature about User Settings. Can you plz support to upload the profile picture for account automatically, Maybe it should look like: $bot->user->profile([profile_image'=>'my-selfie.jpg']);

Like function not working

I think the like function is broken. I'm able to login, post a pin or get pin info. However like doesn't seem to work, as the like count doesn't update on pinterest and the like function below doesn't return anything. For example in the snip below, I'm able to login and $pin_info is an array with all the pin's info however $like_info doesn't return anything and the like count doesn't go up.

            $bot->login($usr, $pwd);
            $pin_info = $bot->pins->info($pin_id);
            print_r($pin_info);
            $like_info = $bot->pins->like($pin_id);
            print_r($like_info);

setOptions not working

Dear @seregazhuk ,

Can you please check why "setOptions" is not working now.

$bot->getHttpClient()->setOptions([
CURLOPT_PROXY => $proxy,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36',

]);
$var = $bot->user->registerBusiness($email, $pass, $rname);

I tried to set proxy and then try to registerBusiness() to create accounts and there are errors as follows:

(I have checked the proxy by Firefox and it works. Also, if I remove the setOptions() instructions, it works fine and can create new accounts)

Catchable fatal error: Argument 2 passed to seregazhuk\PinterestBot\Api\Response
::getValueByKey() must be of the type array, null given, called in E:\xampp\htdo
cs\pinterestNewVersionClientInfo\vendor\seregazhuk\pinterest-bot\src\Api\Respons
e.php on line 80 and defined in E:\xampp\htdocs\pinterestNewVersionClientInfo\ve
ndor\seregazhuk\pinterest-bot\src\Api\Response.php on line 94

Error Getting List of Followers

$pinterest->pinners->followers($username) produces an error:

'resource_response' =>
array(2) {
  'data' =>
  NULL
  'error' =>
  array(5) {
    'api_error_code' =>
    int(30)
    'message' =>
    string(15) "User not found."
    'code' =>
    string(9) "API_ERROR"
    'target' =>
    string(66) "<webapp.resources.user_resource.UserResource object at 0x1b26f110>"
    'http_status' =>
    int(404)
  }
}

The error throws for any valid $username.

Pagination doesn't work

There's a bug in the function:

RequestHelper.php:

public static function createRequestData($data, $sourceUrl = null)
{
    return [
        "source_url" => $sourceUrl,
        "data"       => json_encode($data, JSON_FORCE_OBJECT),
    ];
}

Because of JSON_FORCE_OBJECT, bookmarks are encoded incorrectly:
{"0": "Pz9Nakl5TX...YxNmRjNQ=="}
instead of
["Pz9Nakl5TX...YxNmRjNQ=="]

It makes the option invalid and the first page is always being returned.

PHP Fatal error: Call to a member function isEmpty() on boolean

Доброго дня! Работаю не первую неделю под Windows/Openserver и все работает отлично.
Под Centos + Vesta , PHP 5.6.30 (cli) (как и под Windows) вылазит ошибка. Версия бота "seregazhuk/pinterest-bot": "^5.2.3" под Windows , а Centos - последняя версия 5.2.4.

PHP Fatal error: Call to a member function isEmpty() on boolean in /home/admin/web/11.12.76.157/public_html/vendor/seregazhuk/pinterest-bot/src/Helpers/Pagination.php on line 144

При исполнении такого кода:

        $related = $bot->pins->related('56224695328753842', 500); //Не важно какой pin
        foreach ($related as $pin) {
//mynewbiecode
}

Добегает до определенного пина (например, до 478) и выдает ошибку т.к. чаще всего related < 500 , хотя под Windows на старой версии "бегает" даже если всего 10 пинов.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.