Added Python example to GetPhotoNextPrevious
This commit is contained in:
parent
bd1f82b896
commit
eb93b56ae4
1 changed files with 12 additions and 0 deletions
|
@ -10,6 +10,7 @@ Get Next/Previous Photo
|
||||||
1. [Examples][examples]
|
1. [Examples][examples]
|
||||||
* [Command line][example-cli]
|
* [Command line][example-cli]
|
||||||
* [PHP][example-php]
|
* [PHP][example-php]
|
||||||
|
* [Python][example-python]
|
||||||
1. [Response][response]
|
1. [Response][response]
|
||||||
* [Sample][sample]
|
* [Sample][sample]
|
||||||
|
|
||||||
|
@ -53,6 +54,15 @@ _Authentication: optional_
|
||||||
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
|
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
|
||||||
$response = $client->get("/photo/b/nextprevious.json");
|
$response = $client->get("/photo/b/nextprevious.json");
|
||||||
|
|
||||||
|
<a name="example-python"></a>
|
||||||
|
#### Python (using [openphoto-python][openphoto-python])
|
||||||
|
|
||||||
|
client = openphoto.OpenPhoto()
|
||||||
|
photo = client.photos.list()[1] # Returns the second photo in the list
|
||||||
|
print photo.next_previous()
|
||||||
|
|
||||||
|
{'previous': [<openphoto.objects.Photo id='1eo'>], 'next': [<openphoto.objects.Photo id='1eq'>]}
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
<a name="response"></a>
|
<a name="response"></a>
|
||||||
|
@ -152,8 +162,10 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
|
||||||
[examples]: #examples
|
[examples]: #examples
|
||||||
[example-cli]: #example-cli
|
[example-cli]: #example-cli
|
||||||
[example-php]: #example-php
|
[example-php]: #example-php
|
||||||
|
[example-python]: #example-python
|
||||||
[response]: #response
|
[response]: #response
|
||||||
[sample]: #sample
|
[sample]: #sample
|
||||||
[photogeneration]: http://theopenphotoproject.org/documentation/faq/PhotoGeneration
|
[photogeneration]: http://theopenphotoproject.org/documentation/faq/PhotoGeneration
|
||||||
[ReturnSizes]: http://theopenphotoproject.org/documentation/faq/ReturnSizes
|
[ReturnSizes]: http://theopenphotoproject.org/documentation/faq/ReturnSizes
|
||||||
[openphoto-php]: https://github.com/photo/openphoto-php
|
[openphoto-php]: https://github.com/photo/openphoto-php
|
||||||
|
[openphoto-python]: https://github.com/photo/openphoto-python
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue