Skip to content

Commit

Permalink
feat: in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
iseizuu committed Sep 28, 2024
1 parent 4645917 commit 5431f29
Show file tree
Hide file tree
Showing 78 changed files with 3,036 additions and 9,526 deletions.
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@
<img src="https://img.shields.io/npm/v/anime-wallpaper.svg?logo=npm&logoColor=fff&label=NPM+package&color=red" alt="Anime Wallpaper on npm" />
</a>
</p>
<p align="center">
<p align="center" style="center">
<img src="https://i.imgur.com/DeP0Nlv.jpeg">
</p>

#### [[Documentation](https://iseizuu.github.io/anime-wallpaper/)]

Get Anime wallpapers based on scrapping from websites.
* [4K Wallpapers](https://free4kwallpapers.com/)
* [Wall Haven](https://wallhaven.cc)
* [ZeroChan](https://www.zerochan.net)
* [Wallpapers.com](https://wallpapers.com)
* [Hoyolab](https://www.hoyolab.com/) (New)
* [Pinterest](https://pinterest.com/) (New)

| Website | Type | Status |
|---------|------|-----------|
| [4K Wallpapers](https://free4kwallpapers.com/) | Image ||
| [Wall Haven](https://wallhaven.cc) | Image ||
| [ZeroChan](https://www.zerochan.net) | Image ||
| [Wallpapers.com](https://wallpapers.com) | Image ||
| [Hoyolab](https://www.hoyolab.com/) | Image ||
| [Pinterest](https://pinterest.com/) | Image ||
| [Moe Walls](https://moewalls.com) | Video/Image ||

<br>

[![Version](https://nodei.co/npm/anime-wallpaper.png?compact=true)](https://nodei.co/npm/anime-wallpaper)
Expand All @@ -40,7 +45,7 @@ const { AnimeWallpaper, AnimeSource } = require('anime-wallpaper');
const wallpaper = new AnimeWallpaper();
```

- Getting a random wallpaper from [4K Wallpapers](https://free4kwallpapers.com/) <img align="center" width="15" src="https://cdn.discordapp.com/emojis/735119429016485920.webp?size=128&quality=lossless">
- ~~Getting a random wallpaper from [4K Wallpapers](https://free4kwallpapers.com/)~~

```js
const wallpaper = await wallpaper.random();
Expand Down Expand Up @@ -68,6 +73,15 @@ const wallpaper = await wallpaper.search({ title: "Misaka Mikoto" }, AnimeSource
return console.log(wallpaper)
```

# Live 2D

- Getting Live 2D from [Moe Walls](https://moewalls.com) <img align="center" width="15" src="https://cdn.discordapp.com/emojis/735119429016485920.webp?size=128&quality=lossless">

```js
const wallpaper = await wallpaper.live2d("Jane Doe");
return console.log(wallpaper)
```

# Hoyolab Example
- Get fanart from hoyolab <img align="center" width="15" src="https://cdn.discordapp.com/emojis/735119429016485920.webp?size=128&quality=lossless">

Expand Down
1 change: 1 addition & 0 deletions dist/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export declare const wallHaven = "https://wallhaven.cc";
export declare const zerochan = "https://www.zerochan.net";
export declare const wallpapers = "https://wallpapers.com";
export declare const pinterest = "https://id.pinterest.com/search/pins/";
export declare const moewall = "https://moewalls.com";
export declare const type: {
sfw: string;
sketchy: string;
Expand Down
5 changes: 3 additions & 2 deletions dist/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/hoyo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions dist/structure/client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/typings/enum.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion dist/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ export interface dataImageFormat {
thumbnail?: string;
image?: string;
}
export interface live2D {
title?: string;
thumbnail?: string;
video?: string;
url?: string;
}
export interface searchOpt {
title: string;
page: string;
page?: string;
}
export interface searchForWallhaven {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/typings/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/utils/request.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AxiosResponse } from "axios";
export default class Requested {
constructor();
private makeRequest;
request(uri: string, options: Record<string, unknown>, cookie?: string): Promise<Response>;
request(uri: string, options: Record<string, unknown>, cookie?: string): Promise<AxiosResponse>;
}
14 changes: 9 additions & 5 deletions dist/utils/request.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion dist/wallpaper.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnimeSource, dataImageFormat, hoyoResult, hoyolab, searchForWallhaven, searchOpt } from "./typings";
import { AnimeSource, dataImageFormat, hoyoResult, hoyolab, live2D, searchForWallhaven, searchOpt } from "./typings";
export declare class AnimeWallpaper {
private client;
constructor();
Expand All @@ -14,6 +14,15 @@ export declare class AnimeWallpaper {
*/
search(options: searchOpt | searchForWallhaven, source?: AnimeSource): Promise<dataImageFormat[]>;
/**
* Scrapes live2D images from moewalls.
*
* @param title the title of anime that you want to search.
* @returns {Promise<live2D[]>} A promise that resolves to an array of live2D objects containing information about the retrieved images.
* @throws {WallError} - If the search query is empty or no images are found.
*/
live2d(title: string): Promise<live2D[]>;
/**
* @deprecated
* Scrapes 4kWallpaper for a random Wallpaper
*
* This function will return an array of random Wallpapers
Expand Down Expand Up @@ -66,5 +75,13 @@ export declare class AnimeWallpaper {
* @returns {dataImageFormat} A promise that resolves to an array of dataImageFormat objects containing information about the retrieved images.
*/
private scrapeFromZeroChan;
/**
* Scrapes live2D images from moewalls.
*
* @param search the title of anime that you want to search.
* @returns {Promise<live2D[]>} A promise that resolves to an array of live2D objects containing information about the retrieved images.
* @throws {WallError} - If the search query is empty or no images are found.
*/
private scrapeFromMoewall;
}
export { AnimeSource };
Loading

0 comments on commit 5431f29

Please sign in to comment.