The plugin requires the use of a consumer key, which you can obtain by visiting the settings area and registering a new application.
Plugin options
Stream option
In the sample below we will output 8 small photos from my profile linked to the detail pages on 500px website. The following options are available:
consumer_key
: Your API consumer key, (required).feature
: The type of stream to request, defaults touser
, (optional).user
: username to pull photos from, (required only if feature is set touser
,user_friends
oruser_favorites
).count
: Amount of photos to request, defaults to 5, (optional).image_size
: size of the image to be shown, it defaults to 3 (280 x 280), (optional).sort
: Sort photos in the specified order, (optional).only
: String name of the category to return photos from, (optional).exclude
: String name of the category to exclude photos by, (optional).
For details about option values and response format check the documentation for GET photos.
<!-- Template -->
{{ fhpics:photos count="8" image_size="1" consumer_key="your_key" user="ramono" }}
{{ photos }}
<a href="http://www.500px.com{{ url }}">
<img src="{{ image_url }}" alt="{{ name }}">
</a>
{{ /photos }}
{{ /fhpics:photos }}
Individual option
In this example we pull an individual photo. The available options are:
consumer_key
: Your API consumer key, (required).id
: ID of the image, (required).image_size
: size of the image to be shown, it defaults to 3 which is 280px x 280px, (optional).comments
: Pull image comments, if omitted comments are not available, (optional).
For information on option values for the individual photo and response format check the documentation for Get photos/id.
<!-- Template -->
{{ fhpics:photo id="49017066" image_size="4" comments="1" consumer_key="<your_key>" }}
<figure>
<a href="http://www.500px.com{{ url }}" target="_blank">
<img src="{{ image_url }}" alt="{{ name }}">
</a>
<figcaption>
{{ description }}
{{ camera }} {{ shutter_speed }}s f{{ aperture }} ISO{{ iso }}
</figcaption>
</figure>
{{ /fhpics:photo }}
The plugin is a basic interface for the 500px API, and includes only a few options that should cover most use cases. The API is powerful enough to return many different stream options and a full array of information for each photo, including exif, author and all comments with their authors.
You can find the plugin in its Github page, free and open.
It is by no means finished. There are a few things I'd like to add like a profile option, make better use of the API options and maybe add collections as well. This is a work in progress, I hope you find it useful.