-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated getting started links #123
Merged
davidchaiken
merged 2 commits into
pinterest:main
from
jhauga:updated_getting_started_links
Jul 15, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
# PHP Quickstart | ||
|
||
PHP code that demonstrates the basics of how to use the Pinterest API. | ||
|
||
## Quick Start | ||
|
||
1. Install PHP and check the version. The code for this repo has been tested with PHP version 8. | ||
|
||
1. Follow the directions in the README at the top level of this repo for configuring your application ID and application secret. | ||
|
||
3. From the top of this repo, change your working directory to this directory: `cd php` | ||
|
||
4. Set up the shell environment. | ||
|
||
``` | ||
$ . ../common/scripts/api_env | ||
``` | ||
|
||
5. Run the php server in this directory on the port configured when following the instructions in the top-level README. | ||
|
||
``` | ||
$ php -S localhost:8085 | ||
``` | ||
6. [Click here](http://localhost:8085/) or point your browser at http://localhost:8085. | ||
|
||
## Troubleshooting | ||
|
||
* If you see the error `Warning: session_start(): Cannot start session when headers already sent`, you're likely using a version of PHP lower than 8. This example requires PHP version 8, so you'll need to install the latest version. | ||
|
||
* If the redirect to Pinterest returns a 400 error that says "Oops! You must pass a value for client_id," check to verify that the `api_env` script has been run properly. | ||
``` | ||
$ env | grep PINTEREST_APP_ID | ||
PINTEREST_APP_ID=<your application id> | ||
``` | ||
|
||
* If the demo code that fetches user account information fails, check to make sure that the user account has a profile picture and at least one saved Pin. | ||
|
||
## Code Conventions | ||
|
||
This PHP code needs to pass the [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) linter using | ||
the default PEAR coding standard. To run the linter, first install the PHP_CodeSniffer. For example, on MacOS | ||
configured with HomeBrew, install with: | ||
``` | ||
brew install php-code-sniffer | ||
``` | ||
Then, run the linter with `make lint` or `phpcs <filename>`. Run the code fixer | ||
with `make lint-fix` or `phpcbf <filename>`. | ||
|
||
`make lint` will be run automatically for pull requests. | ||
# PHP Quickstart | ||
PHP code that demonstrates the basics of how to use the Pinterest API. | ||
## Quick Start | ||
1. Install PHP and check the version. The code for this repo has been tested with PHP version 8. | ||
1. Follow the directions in the README at the top level of this repo for configuring your application ID and application secret. | ||
3. From the top of this repo, change your working directory to this directory: `cd php` | ||
4. Set up the shell environment. | ||
``` | ||
$ . ../common/scripts/api_env | ||
``` | ||
5. Run the php server in this directory on the port configured when following the instructions in the top-level README. | ||
``` | ||
$ php -S localhost:8085 | ||
``` | ||
6. [Click here](http://localhost:8085/) or point your browser at `http://localhost:8085`. | ||
## Troubleshooting | ||
* If you see the error `Warning: session_start(): Cannot start session when headers already sent`, you're likely using a version of PHP lower than 8. This example requires PHP version 8, so you'll need to install the latest version. | ||
* If the redirect to Pinterest returns a 400 error that says "Oops! You must pass a value for client_id," check to verify that the `api_env` script has been run properly. | ||
``` | ||
$ env | grep PINTEREST_APP_ID | ||
PINTEREST_APP_ID=<your application id> | ||
``` | ||
* If the demo code that fetches user account information fails, check to make sure that the user account has a profile picture and at least one saved Pin. | ||
## Code Conventions | ||
This PHP code needs to pass the [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) linter using | ||
the default PEAR coding standard. To run the linter, first install the PHP_CodeSniffer. For example, on MacOS | ||
configured with HomeBrew, install with: | ||
``` | ||
brew install php-code-sniffer | ||
``` | ||
Then, run the linter with `make lint` or `phpcs <filename>`. Run the code fixer | ||
with `make lint-fix` or `phpcbf <filename>`. | ||
`make lint` will be run automatically for pull requests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only line edited. Copied and pasted full contents from editor to GitHub may have caused new line difference.