dirkgroenen / pinterest-api-php

A PHP wrapper for the official Pinterest API. :pushpin:

Home Page:https://developers.pinterest.com/docs/getting-started/introduction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sanitize board name

UVLabs opened this issue · comments

Currently we're manually removing special characters from board names to create the board id. Pinterest turns spaces into - and it strips out most special characters with the exception so far being ~ and +(which it turns + into %2B)

Would be cool if there was an inbuilt function in this wrapper to do that

I'm not sure if I get what you're asking for. Are you saying Pinterest returns an error when you provide a non-sanitized ID, or would it "just be nice" to have a sanitizer that behaves the same as Pinterest'?

@dirkgroenen sorry for the late reply here, and the answer to your question is Pinterest returns an error when you don't sanitize the ID.

If you have a board name "my board", check the address bar on Pinterest.com, Pinterest automatically adds the - and makes it "my-board"

So the actual board ID is "my-board", if you use the "board name" as is, then it would return an error because board name !== board id

I'm not sure if this library would be the right place for such a future. It sounds like you're trying to set a board's ID in advance the same way as Pinterest would do so. If that's true then why not just skip the ID and use the ID Pinterest returns?

If you don't agree I would love to see an example of some sorts which elaborates your feature request.