new Px500Source(useKey, photosKey, type, desc, isDaily, isArray [, loadArg])
Create a new photo source
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
useKey |
string | The key for if the source is selected |
||
photosKey |
string | The key for the collection of photos |
||
type |
string | A descriptor of the photo source |
||
desc |
string | A human readable description of the source |
||
isDaily |
boolean | Should the source be updated daily |
||
isArray |
boolean | Is the source an Array of photo Arrays |
||
loadArg |
Object |
<optional> <nullable> |
null | optional arg for load function |
- Source:
Members
-
<private, static, constant> _CATS :Array
-
Categories to use Make them an array to overcome 100 photo limit per call
Type:
- Array
- Default Value:
-
- ["Nature,City and Architecture","Landscapes,Animals","Macro,Still Life,Underwater"]
- Source:
-
<private, static, constant> _KEY :string
-
API authorization key
Type:
- string
- Source:
-
<private, static, constant> _MAX_PHOTOS :int
-
Max photos to return - 100 is API max
Type:
- int
- Default Value:
-
- 90
- Source:
-
<private, static, constant> _URL_BASE :string
-
500px rest API
Type:
- string
- Default Value:
-
- https://api.500px.com/v1/
- Source:
Methods
-
<private, static> _doGet(url) → {Promise.<Array.<app.PhotoSource.Photo>>}
-
Call API to get some photos
Parameters:
Name Type Description url
string server url
- Source:
Returns:
Array of photos
- Type
- Promise.<Array.<app.PhotoSource.Photo>>
-
fetchPhotos() → {Promise.<Array.<app.PhotoSource.Photo>>}
-
Fetch the photos for this source
- Source:
Returns:
Array of photos
- Type
- Promise.<Array.<app.PhotoSource.Photo>>