Members
(constant) env_whitelist :Array.<string>
- Source:
- Default Value:
[ "LOG_LEVEL", "TUMBLR_USERNAME", "TUMBLR_PASSWORD", "USERNAME", "PASSWORD", "PROXY_URL", "HTTP_PROXY" ]
The environment variables that can be used to configure the application.
Type:
- Array.<string>
(constant) TUMBLR_LOGIN_FORM :object
- Source:
The default login form that will be POSTed.
Type:
- object
(constant) TUMBLR_MOBILE_USER_AGENT :string
- Source:
- Default Value:
- Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1
The default user agent that will be used with all XHR requests.
Is a mobile user agent to ensure Tumblr sends a mobile-formatted page.
Type:
- string
(constant) TUMBLR_USER_AGENT :string
- Source:
- Default Value:
- Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1
The default user agent that will be used with non-XHR requests.
Type:
- string
Methods
(async) download(nconf, logs) → {Promise.<number>}
Downloads a blog saving it to a directory.
Parameters:
Name | Type | Description |
---|---|---|
nconf |
Provider | The nconf instance. |
logs |
Logger | The winston logger. |
Returns:
- Returns the exit code.
- Type
- Promise.<number>
getPhotoPath(parentDir, photo) → {string}
Returns the path to a Photo within a parent directory.
Parameters:
Name | Type | Description |
---|---|---|
parentDir |
string | The parent directory the photos are contained in. |
photo |
Photo | The photo to extra data from. |
Returns:
- The path of the photo.
- Type
- string
(async) main() → {Promise}
Main function for the application.
Returns:
- Returns the exit code.
- Type
- Promise
Type Definitions
PageChangeEvent
- Source:
Properties:
Name | Type | Description |
---|---|---|
blogSubdomain |
string | Subdomain of the blog being scraped. |
pageNumber |
number | Page the scraper is currently on in the blog. |
index |
number | How many pages have been scraped so far. |
Represnets an object that will be sent with TumblrImageDownloader#pageChange
Photo
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
photoId |
string | Unique ID of the photo. | |
photoUrl |
string | URL of the photo. | |
tags |
Array.<string> | Tags that belong to the photo. | |
author |
string | Original author of the photo. | |
photoBytes |
Buffer |
<optional> |
The actual downloaded photo. |
Represents data on a individual photo.
Type:
- Object
PhotosetPhoto
- Source:
Properties:
Name | Type | Description |
---|---|---|
photoId |
string | ID of the photo |
photoUrl |
string | URL of the photo |
Photo in a photoset.
Type:
- Object
ScrapeBlogOptions
- Source:
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pageNumber |
number |
<optional> |
Page number to start at. | |
blogSubdomain |
string | Subdomain of the blog to scrape from. | ||
downloadPhotos |
boolean |
<optional> |
false
|
Download the photos rather than just grabbing the URLs. |
returnPhotos |
boolean |
<optional> |
false
|
Returns all of the photos as an array. |
stopAtIndex |
number |
<optional> |
Stop after scraping this many pages. | |
stopAtPage |
number |
<optional> |
Stop when this page in the blog is reached. | |
predownloadFilter |
function |
<optional> |
A function that will be used to filter Photos before downloading them. |
Options that can be used with TumblrImageDownloader#scrapeBlog.
TumblrImageDownloaderOptions
- Source:
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
cookie_jar |
CookieJar |
<optional> |
A tough-cookie compatiable cookie jar. The CookieJar object must be created with `looseMode` set to `true`. | |
user_agent |
string |
<optional> |
TUMBLR_USER_AGENT
|
The user-agent that will be used for desktop requests. |
mobile_user_agent |
string |
<optional> |
TUMBLR_MOBILE_USER_AGENT
|
The user-agent that will be used for mobile requests. |
proxy_url |
string |
<optional> |
URL to a proxy (SOCKS,HTTP or Pac) that will be used with each request. Will be passed to proxy-agent |
Options that can be passed to the constructor
TumblrLoginResponse
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
already_logged_in |
boolean |
<optional> |
Indicates if a session already exists for this account. |
Type:
- Object