new RedditSource(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> _KEY :string
-
Reddit rest API authorization key
Type:
- string
- Source:
-
<private, static, constant> _MAX_PHOTOS :int
-
Max photos to return
Type:
- int
- Default Value:
-
- 100
- Source:
-
<private, static, constant> _MAX_SIZE :int
-
Max size of photo to use
Type:
- int
- Default Value:
-
- 3500
- Source:
-
<private, static, constant> _MIN_SIZE :int
-
Min size of photo to use
Type:
- int
- Default Value:
-
- 750
- Source:
-
<private, static, constant> _REDIRECT_URI :string
-
Extension's redirect uri
Type:
- string
- Source:
-
<private, static> _snoocore :function
-
Expose reddit API
Type:
- function
- Source:
Methods
-
<private, static> _getSize(title) → {Object}
-
Parse the size from the submission title. this is the old way reddit did it
Parameters:
Name Type Description title
string submission title
- Source:
Returns:
Photo size
- Type
- Object
-
<private, static> _processChildren(children) → {Array.<app.PhotoSource.Photo>}
-
Build the list of photos for one page of items
Parameters:
Name Type Description children
Array Array of objects from reddit
- Source:
Returns:
Array of photos
- Type
- 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>>