Comments (58)
@huuvu1109 Hi, I've published a new release with profile fix (5.5.1). Update, please.
from php-pinterest-bot.
@huuvu1109 Can you please open an issue with the same description and pictures?
It will be much easier for me to track the incoming feature requests. Now I have to look through the closed issues and scroll to the last comment :)
from php-pinterest-bot.
Hi @huuvu1109 ,
Fixed in 4.13.2!
from php-pinterest-bot.
It works now. Thanks!
from php-pinterest-bot.
@huuvu1109 please update again. In the latest version, update
method was fixed, but any pagination (search, followers, feeds and so on) has been broken.
It is fixed in 4.13.3
from php-pinterest-bot.
Hi @seregazhuk ,
It seems that $categories = $bot->interests->main(); not works anymore. Can you plz check.
Also, I think it is more clear if you can update $bot->user->login('mypinterestlogin', 'mypinterestpassword'); in the Quick Start for consistency.
Thanks,
from php-pinterest-bot.
Hi, @huuvu1109
Oh, thank you, I didn't notice, that quick start section is outdated! Thank you!
I've tried main categories and it works:
$bot = PinterestBot::create();
$bot->auth->login('login', 'pass');
print_r($bot->interests->main());
print_r($bot->getLastError());
/*
Array
(
[0] => Array
(
[images] => Array
(
[45x] => Array
(
[url] => https://s-media-cache-ak0.pinimg.com/categories/architecture-1384730671-45x.jpg
[width] => 45
[height] => 45
)
)
[category_type] => main
[type] => category
[name] => Архитектура
[key] => architecture
)
[1] => Array
(
[images] => Array
(
[45x] => Array
(
[url] => https://s-media-cache-ak0.pinimg.com/categories/technology-1384730521-45x.jpg
[width] => 45
[height] => 45
)
)
[category_type] => main
[type] => category
[name] => Гаджеты
[key] => technology
)
...
*/
What is your output, or you get some errors?
from php-pinterest-bot.
Thanks @seregazhuk , I just check again and the reason is that I use an old password and it can not login ==> $bot->interests->main() return nothing. I don't realize this because the bot return nothing when it can not login. I think it is better if you still keep to return an exception if the Login not successful as before.
from php-pinterest-bot.
The bot should return true
or false
from login()
method. I don't think it is a good idea to throw an exception at login. Maybe it is better to check the returned value, than to catch an exception. What was returned in your case?
from php-pinterest-bot.
Hi @seregazhuk ,
I see. I didn't realize that the bot return true, false because I just look at Quick Start. Everything is ok now. Thanks!
from php-pinterest-bot.
Hi @seregazhuk ,
Currently, for User Settings, it is possible to change the settings for : last_name, first_name, username, about, location, website_url and profile_image. Can you please also add "country" to the supported options?
from php-pinterest-bot.
Hi @huuvu1109 , It is not documented, but it works. Just pass country
with iso2 code like this:
$bot->user->profile(['country' => 'DE']);
I'll add it to the docs.
from php-pinterest-bot.
got it. Thanks!
from php-pinterest-bot.
Hi @seregazhuk ,
Can you please check if the follow function : $bot->pinners->follow still work? It seems that something wrong, when I use this function, the account is immediately suspended.
Thanks,
from php-pinterest-bot.
@huuvu1109 Hi, no, it still works fine, I've just checked it.
Maybe the user, you try to follow, complained about you.
from php-pinterest-bot.
Hi @seregazhuk ,
Thanks for your quick reply. It is really weird, something like Pinterest have a trap on the follow function to suspend accounts. After your comments, I tried to follow my own account to ensure there are no complaints, it is still suspended immediately after following. Then, I tried to change the IP, it is still died. Then, I used the account which have created a long time, it is died again. I'm using the newest version.
from php-pinterest-bot.
Hmm, how can I reproduce this issue? Does it happen only with your current accounts? If you create a new one and try to follow? What are your steps? Simply login and then follow, or maybe such follow behaviour is a side effect of something else?
from php-pinterest-bot.
I think I know the problem now. I have tested it carefully. I use the account created by your bot, follow by the code, it dies. If I use another account created by your bot, follow by hand , it still die. However, I tried to create a new account by hands, then, it is ok to use the function to follow, by code or by hand. So, I think there are some problem in the registration function of the bot. One possible reason is when you register by hand, you must follow several topics immediately. However, by the bot, we can create the accounts without following any boards. I think you can check this.
from php-pinterest-bot.
oh, I just detect that I used the old version to create the Accounts and it leads to Suspended when follow. I just update the newest version, use newest version to create the accounts, and it works ok to follow other accounts.
from php-pinterest-bot.
I see, there was an issue with registrations a month ago. I close this issue. Try to follow updates)
from php-pinterest-bot.
Hi @seregazhuk ,
When you access to a pin without logging into your account, Pinterest not only show you the Pin you want to access, but also recommend a list of Pins which are similar to your pin. For example, let open the incognito window, and open this url: https://www.pinterest.com/pin/83527768070255703/ , then, you can see the result as the below figure:
Can you plz add one more feature to have these information. I have tried to use $info = $bot->pins->info() without logging in to account, but it seems that it doesn't work.
Thanks!
from php-pinterest-bot.
@huuvu1109 Hi!
This feature is already implemented. You can use it also when you are logged in. Try this:
foreach($bot->pins->related($pinId) as $pin) {
//...
}
// or get all of them at once as an array
$relatedPins = $bot->pins->related($pinId)->toArray();
from php-pinterest-bot.
Hi @seregazhuk ,
Thanks for your quick reply. I just try to use $bot->pins->related($pinId) . And it works, it returns the related pins. But can not get the "explore" text like in the returned result like in the following figure (in the red rectangle). Is it possible to get this also?
from php-pinterest-bot.
Fixed in 2.5.6
Yes, you should be not logged in to use this feature. Data, you are looking for is placed in pin_join
array:
$related = $bot->pins->related('83527768070255703');
foreach ($related as $pin) {
if($pin['id'] == 355784439289886021) {
print_r($pin['pin_join']); die();
}
}
from php-pinterest-bot.
Hi @seregazhuk ,
Have you submitted the code yet? I just update the code and try again but there are still no "pin_join" results.
from php-pinterest-bot.
Oh, @huuvu1109 sorry, I've published wrong release number. Version 5.2.6 is actual. Try to update now.
from php-pinterest-bot.
Hi @seregazhuk ,
The date "pin_join " works fine now. I have one more question. Can you also support to add the Sex (Male, Female) when creating accounts. When I create by hands, we have this option. So I think you should also support this to make it like normal person instead of a bot.
from php-pinterest-bot.
Yes, @huuvu1109
I'm working on it. I don't like this ugly register
method as it is now. It accepts 5 arguments, and you should remember their order. That first comes email, then password, then �name, and so on.
I am going to rewrite it and create a fluent interface, something like this:
$bot->auth
->setName('name')
->setPassword('pass')
->setAge(30)
->setMaleGender()
->register();
So you can chain these call and there is no need to remember all of these arguments and their order.
from php-pinterest-bot.
Thanks, it's nice. Currently, it has 5 arguments, and also if you support "Gender" , so it will be 6 arguments:
from php-pinterest-bot.
Hi @seregazhuk ,
I just list the arguments again:
- '[email protected]',
- 'password',
- 'Name' -> it is nice now, but it can be more natural if it is separated to: First Name + Last Name like registering by hand.
- Country:
- Age:
- Gender
from php-pinterest-bot.
Hi, @huuvu1109
It's done! In version 5.2.7 you can use form objects for registration and change profile settings. These classes have a fluent interface, so there is no need to remember all the parameters names and their order. Only set those values, that you need. Of course, the old version also still works, so nothing will be broken after update.
Registration:
use seregazhuk\PinterestBot\Api\Forms\Registration;
$registration = new Registration('[email protected]', 'password', 'name');
$registration
->setAge(30)
->setCountry('DE')
->setMaleGender(); // ->setFemaleGender()
$bot->auth->register($registration);
the same with business registration:
use seregazhuk\PinterestBot\Api\Forms\Registration;
$registration = new Registration('[email protected]', 'password', 'name');
$registration
->setAge(30)
->setCountry('DE')
->setMaleGender()
->setSite('http://yoursite.com');
$bot->auth->registerBusiness($registration);
Change profile.
To update profile you need to setup Profile
form object. It has following methods:
setLastName()
,setFirstName()
,setUserName()
,setAbout()
,setLocation()
,setWebsiteUrl()
,setCountry()
(ISO2 code)setImage()
:
use seregazhuk\PinterestBot\Api\Forms\Profile
$profileForm = (new Profile())
->setFirstName('John')
->setLastName('Doe')
->setAbout('My bio')
->setCountry('UK');
$bot->user->profile($profileForm);
You can change your profile avatar by using setImage()
method and a path to your image:
use seregazhuk\PinterestBot\Api\Forms\Profile
$profileForm = (new Profile())->setImage($pathToFile);
$bot->user->profile($profileForm);
from php-pinterest-bot.
Hi @seregazhuk. It's very nice. Thanks!
from php-pinterest-bot.
Hi @seregazhuk ,
When we already logged in, Pinterest allows us to discover trending pins based on topics by using this link: https://www.pinterest.com/discover/ . Can you plz also support to get these trending pins (by topics)?
from php-pinterest-bot.
Hi, @huuvu1109
Get version 5.3.0 and then use like this.
Get trending pins for a specific topic from http://pinterest.com/discover page. Uses topic id, that can be received from $bot->topics->explore()
method (returns Pagination object):
$trendingTopics = $bot->topics->explore();
$firstTopicId = $trendingTopics[0]['id'];
$pins = $bot->pins->explore($firstTopicId)->toArray();
from php-pinterest-bot.
thanks a lot @seregazhuk
from php-pinterest-bot.
Hi @seregazhuk ,
It seems that there are some errors with the Registration again. I tried the new code and it not works. Can you plz check again.Thanks!
// You may need to amend this path to locate composer's autoloader
require('vendor/autoload.php');
use seregazhuk\PinterestBot\Factories\PinterestBot;
use seregazhuk\PinterestBot\Api\Forms\Registration;
$email = "[email protected]";
$pass = "abcdef123456789";
$fullName = "DDDDDD AAAA";
$iNumberOfAge = 80;
$bot = PinterestBot::create();
$registration = new Registration($email, $pass, $fullName);
$registration
->setAge(30)
->setCountry('DE')
->setMaleGender(); // ->setFemaleGender()
$bot->auth->register($registration);
from php-pinterest-bot.
Hi @huuvu1109 , thank you for your feedback! Yes, something is broken. I will try to fix it today/tomorrow.
from php-pinterest-bot.
@huuvu1109 done! get the latest version v5.3.1
from php-pinterest-bot.
@seregazhuk It works well now. Thanks a lot for your quick fix.
from php-pinterest-bot.
Hi @seregazhuk ,
I see that Pinterest usually send us some suggestions by emails like the following figure:
In the figure, when we click on the board, it will open the board with link like the following.
Is it possible to support this action also? I mean to simulate the "click" action from the email. I think it is something like to support the bot to send "GET" or "POST" requests:
For example, after loggined,
$bot->auth->login('mypinterestlogin', 'mypinterestpassword', false);
then,the $bot can send two kinds of requests:
$bot->sendGetRequest("link", arrayOfGetParameters());
$bot->sendPostRequest("link",arrayOfPostParameters());
Thanks,
from php-pinterest-bot.
Hi, @huuvu1109
To "click" a link you can use something like $bot->user->visitPage($url)
. But it will only visit this page, you won't be able to get any data from it.
The bot has these get
and post
methods, by they are protected and hidden from the client code. There is often no need to make a post request because you need to find out appropriate request data, it's format and many other details. There is often a more abstract action (edit profile, create a comment).
I'll add $bot->user->visitPage($url)
to the documentation, as it may be useful for "clicking" URLs, but I don't see and valid reason to add something like sendPostRequest
to public API.
from php-pinterest-bot.
Hi @seregazhuk ,
I see, I think visitPage($url) is enough for clicking URLs. Thanks!
from php-pinterest-bot.
Hi @seregazhuk , it seems that $info = $bot->getClientInfo(true); not work in the current version if we use Socks $bot->getHttpClient()->useSocksProxy(ip, '22', 'user:pass'); . Can you please fix this. Thanks!
from php-pinterest-bot.
Hi @huuvu1109 I think it is the issue with your proxy, not with the library. Does it work without proxy? When using this proxy all other methods work?
from php-pinterest-bot.
I checked it, @seregazhuk . The problem comes from my proxy. THanks!
from php-pinterest-bot.
Hi @seregazhuk ,
The functions $profile = $bot->user->profile();, $username = $bot->user->username(); $userId = $bot->user->id(); doesn't work in the current version. Can you please fix this. Thanks!
from php-pinterest-bot.
Hi, @huuvu1109 I cannot reproduce it. To me everything works fine. Can you show me your code. And what returns $bot->getLastError()
?
from php-pinterest-bot.
Hi @seregazhuk ,
The last error is: "This account is not a partner account." .
I tried the following process. I create an account first, then login to that account, follow some topics and get the username and userID.
from php-pinterest-bot.
Note that I create account successfully, can follow the topics, but when I request for username and userID, it returns empty.
from php-pinterest-bot.
Still can't reproduce it. Here Is my code.
$bot = PinterestBot::create();
$bot->auth->register('[email protected]', 'secret', 'mike');
$bot->auth->login('[email protected]', 'secret', 'mike');
$bot->topics->follow('content-marketing');
var_dump($bot->user->id());
var_dump($bot->getLastError());
May be you got banned?
from php-pinterest-bot.
Hi @seregazhuk ,
This is the output of your code with changes on emails to create new accounts:
string(18) "854347129219492393"
NULL
Do you use composer require seregazhuk/pinterest-bot to get the newest version? I tested on the newest version.
from php-pinterest-bot.
To get the latest version you should use composer update
. I still can not reproduce your bug.
from php-pinterest-bot.
Hi @seregazhuk ,
I know where is the error now, something wrong with the function $profileForm = (new Profile())->setImage("aaaa.jpg"); .
- For example, this code is fine:
$bot = PinterestBot::create();
$bot->auth->register('[email protected]', 'secret', 'mike');
$bot->auth->login('[email protected]', 'secret', 'mike');
$bot->topics->follow('content-marketing');
var_dump($bot->user->id());
var_dump($bot->getLastError());
$profileForm = (new Profile())->setImage("aaaa.jpg");
$bot->user->profile($profileForm);
- But this code can NOT get the userID, the different is from calling setImg before calling $bot->user->id()
$bot = PinterestBot::create();
$bot->auth->register('[email protected]', 'secret', 'mike');
$bot->auth->login('[email protected]', 'secret', 'mike');
$bot->topics->follow('content-marketing');
$profileForm = (new Profile())->setImage("aaaa.jpg");
$bot->user->profile($profileForm);
var_dump($bot->user->id());
var_dump($bot->getLastError());
from php-pinterest-bot.
Thank you! I see the problem now. Tomorrow will be fixed.
from php-pinterest-bot.
Hi @seregazhuk ,
Pinterest has one feature which allow one pinner to share a pin on Facebook, Twitter, ... like the first figure . The shared content will contains a link to the shared Pin and allow other Pinners can vote the shared Pin (the second figure). Can the bot do this automatically? I mean to share a pin, get the shared link (created by Pinterest), and another account to use that link to vote. Thanks!
from php-pinterest-bot.
Hi, @huuvu1109
Yes, it is possible. Will be added in the future release
from php-pinterest-bot.
Got it @seregazhuk . Next time, I will create a new issue. Thanks!
from php-pinterest-bot.
hello;
user registeration issue please help me;
code :
$registration = new Registration('[email protected]', '123456aab+-', 'volkan');
$registration
->setAge(30)
->setCountry('DE')
->setMaleGender()
->setSite('http://candytaylor13.com');
$return = $bot->auth->registerBusiness($registration);
error: string(19) "Invalid parameters."
from php-pinterest-bot.
Related Issues (20)
- Create APP and Get Token
- Problem to create a new pin HOT 6
- [Invalid email.] When Registering Pinterest
- Здравствуйте.
- Registration error: Invalid parameters. HOT 2
- account banned HOT 1
- how can be scheduled images to go live at a later date on pinterest using api in php? HOT 1
- Keywords recommend not working anymore HOT 1
- Can we create a pin with access_token?
- Domain Spam or Blocked Check?
- Error when create acc
- is it possible to add multiple keywords ? HOT 4
- Pinterest rate limits HOT 2
- Get Boards Return Empty
- Observing the PhP Fatal Error again with the v5.9.1 HOT 9
- Can you please help me to use the edit command ?
- Your requirements could not be resolved to an installable set of packages.
- Autoloader issue
- Login method not working HOT 9
- Is this project dead? Cannot connect Pinterest Account.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-pinterest-bot.