Get Anime wallpapers based on scrapping from websites.
- 4K Wallpapers
- Wall Haven
- ZeroChan
- Wallpapers.com
- Hoyolab (New)
- Pinterest (New)
npm install anime-wallpaper
or
yarn add anime-wallpaper
At the head of your file, start by importing the necessary classes
const { AnimeWallpaper, AnimeSource } = require('anime-wallpaper');
const wallpaper = new AnimeWallpaper();
- Getting a random wallpaper from 4K Wallpapers
const wallpaper = await wallpaper.random();
return console.log(wallpaper)
- Getting Wallpaper from WallHaven
const wallpaper = await wall.search({ title: "firefly honkai", page: 1, type: "sfw", aiArt: true }, AnimeSource.WallHaven);
return console.log(wallpaper)
- Getting Wallpaper from Wallpapers.com
const wallpaper = await wallpaper.search({ title: "Keqing" }, AnimeSource.Wallpapers);
return console.log(wallpaper)
- Getting Wallpaper from ZeroChan
const wallpaper = await wallpaper.search({ title: "Misaka Mikoto" }, AnimeSource.ZeroChan);
return console.log(wallpaper)
const wallpaper = await wall.hoyolab({ game: "GenshinImpact", postType: "Trending" });
return console.log(wallpaper)
{
data: {
list: [
{
game: {...},
post: {...},
topics: [{...}]
user: {...}
}
]
}
}
const wallpaper = await wall.pinterest("Ellen Joe ZzZ");
return console.log(wallpaper)
- nb: sometimes it might be fail when scraping pinterest, just try again and over again :>
In some rare cases, the fetching process might fail due to inconsistencies when scraping websites.
Fork then clone the project and install its dependencies:
npm i
In the root folder of the project type the following to compile the .ts into .js
tsc
© Aizuu