Comments (9)
Hi, @zjzeit
When you are trying to fetch business account boards, are you logged in you business account?
I've just created a secret board and it was returned only if I was logged in this account. For other accounts it stays invisible.
from php-pinterest-bot.
I am logged into the business account. To verify: I was able to pin from a business account to a secret board using the board ID (thus proving the credentials work). That is sufficient for what I need (I can hardcode the secret boardID), I'm just not able to fetch the secret board via boards->forUser(). I'm wondering if Pinterest doesn't respond with secret boards when the query returns > 20 (or some number) of results. Thanks for this awesome code!
from php-pinterest-bot.
I cannot reproduce it. I've registered a new business account. Created 88 public and 8 private boards.
All of them can be fetched.
My credentials: [email protected]: secret
Try it yourself:
$bot = PinterestBot::create();
$bot->auth->login('[email protected]', 'secret');
$boards = $bot->boards->forUser('bimutriche');
echo count($boards); // 96
from php-pinterest-bot.
Ah thanks for the demo! I was able to replicate the issue but realized the issue only existed because I modified your getUser function. The issue was certainly on my end.
Within forUser() I changed the below, which caused the problem.
from
return $this->execGetRequest(['username' => $username], UrlBuilder::RESOURCE_GET_BOARDS);
to
return $this->execGetRequest(['username' => $username,'field_set_key'=>'detailed'], UrlBuilder::RESOURCE_GET_BOARDS);
After undoing that change, I was able to get all the secret boards again.
I made the change because I needed more board information from the request (I needed all board image_cover_urls and pin_counts, but wanted to only make 1 query), but this resulted in only grabbing public boards.
If you have a way to grab all of a user's boards (including extra data like the image_cover_url and pin_count), that would be awesome. Sorry to post an issue that was really my own issue [:
from php-pinterest-bot.
Oh, I see. I'll research it. Now you can use this
$bot->boards->info('username', 'boardname');
to get board detail information.
from php-pinterest-bot.
Gotcha. That would involve iterating through each board as in:
for ($bot->boards->forUser('username') as $board)
{
$bot->boards->info($board['name']); // note: replace key with whatever key gives the board name
}
Calling info()
on each instance would be a lot of URL requests to Pinterest. I was hoping to avoid that many requests, No need to research it on my account! (Unless you are just curious, which I definitely understand). I have accomplished what I need.
from php-pinterest-bot.
@zjzeit
Was field_set_key
the only change you made?
I've updated the method like you:
/**
* Get boards for user by username.
*
* @param string $username
*
* @return array|bool
*/
public function forUser($username)
{
$options = [
'username' => $username,
'field_set_key'=>'detailed',
];
return $this->execGetRequest($options, UrlBuilder::RESOURCE_GET_BOARDS);
}
And it still returns all the boards. Do you have any ideas with your issue behaviour?
from php-pinterest-bot.
Yeah it's weird: because I cannot replicate the issue with a generated business account, I don't know how to diagnose it. field_set_key
was the only change I made. It's not an issue anymore as I can still get the data I need.
from php-pinterest-bot.
Maybe it was an issue on Pinterest side. Anyway, in the next release, I will add 'field_set_key'=>'detailed'
as a default behavior for boards-> forUser()
method.
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.