1.4.6 • Published 4 years ago
awse v1.4.6
What is this?
Getting anime wallpapers from websites.
List of available websites:
alphacoders,wallpaperflare,pikabu,goodfon
Installation
npm i awse --save
How to use?
To get started, export the site you need or several at once.
const { Alphacoders, wallpaperflare, pikabu, goodfon } = require("awse");Or use the getAnySite function. It performs a get function on a random site instance.
const { getAnySite } = require("awse");Usage example
pikabu.get({
search: "Neko",
pages: 1
}).then(d => console.log(d.url, d.images, d.pages, d.timeout));
console.log(pikabu.url) // Link to website (https://pikabu.ru/)getAnySite({
search: "Black Clover",
pages: 2,
minImages: 100
}).then(d => console.log(d.url, d.images, d.pages, d.timeout));Parameters of the get(options) function
- options
:object- search options:- search
:string- the tag by which the search is performed. - pages
:number- (optional) the number of pages to read (Default to 1). The number may increase if the number of images found is less forminImages - minImages
:number- (optional) the minimum number of images to read (Default to 0).
- search
The result of executing the get function
The result of execution will be Promise <Data>.
Data - Contains data received from the site:
Properties:
- url
:string- Link to website. - sources
:Set<string>- An array of links from which the images were searched for. - images
:Set<string>- List of image images. - timeout
:number- Function execution time. - pages
:number- Number of pages viewed.
- url
Methods:
- randomRange(range)
:string[]- Selects random images from the list.
- randomRange(range)