Skip to content

Commit 34c33d8

Browse files
authored
Merge pull request #15 from iseizuu/in-dev
Release 3.2.1
2 parents 827daa8 + 4645917 commit 34c33d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+770
-156
lines changed

.eslintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
{
32
"env": {
43
"browser": true,
@@ -25,10 +24,12 @@
2524
"warn", { "before": false, "after": true }
2625
],
2726
"@typescript-eslint/no-empty-function": "off",
28-
"@typescript-eslint/indent": ["warn", 4],
27+
"@typescript-eslint/indent": "warn",
2928
"@typescript-eslint/no-unsafe-assignment": "off",
3029
"@typescript-eslint/restrict-template-expressions": "off",
30+
"@typescript-eslint/no-unused-vars": "error",
3131
"@typescript-eslint/unbound-method": "off",
32+
"@typescript-eslint/semi": "error",
3233
"no-empty-function": "off",
3334
"comma-style": "error",
3435
"quotes": ["warn", "double"]

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Get Anime wallpapers based on scrapping from websites.
1818
* [Wall Haven](https://wallhaven.cc)
1919
* [ZeroChan](https://www.zerochan.net)
2020
* [Wallpapers.com](https://wallpapers.com)
21-
* [Hoyolab](https://www.hoyolab.com/)
21+
* [Hoyolab](https://www.hoyolab.com/) (New)
22+
* [Pinterest](https://pinterest.com/) (New)
2223
<br>
2324

2425
[![Version](https://nodei.co/npm/anime-wallpaper.png?compact=true)](https://nodei.co/npm/anime-wallpaper)
@@ -68,10 +69,10 @@ return console.log(wallpaper)
6869
```
6970

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

7374
```js
74-
const wallpaper = await wall.Hoyolab({ game: "GenshinImpact", postType: "Trending" });
75+
const wallpaper = await wall.hoyolab({ game: "GenshinImpact", postType: "Trending" });
7576
return console.log(wallpaper)
7677
```
7778
#### Result
@@ -91,6 +92,16 @@ return console.log(wallpaper)
9192
9293
```
9394

95+
# Pinterest
96+
- Getting image from pinterest <img align="center" width="20" src="https://cdn3.emoji.gg/emojis/5505-idle-status.png">
97+
98+
```js
99+
const wallpaper = await wall.pinterest("Ellen Joe ZzZ");
100+
return console.log(wallpaper)
101+
```
102+
103+
- nb: sometimes it might be fail when scraping pinterest, just try again and over again :>
104+
94105
## Warning
95106
In some rare cases, the fetching process might fail due to inconsistencies when scraping websites.<br><br>
96107

dist/config.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export declare const free4kWallpaper = "https://free4kwallpapers.com";
22
export declare const wallHaven = "https://wallhaven.cc";
33
export declare const zerochan = "https://www.zerochan.net";
44
export declare const wallpapers = "https://wallpapers.com";
5+
export declare const pinterest = "https://id.pinterest.com/search/pins/";
56
export declare const type: {
67
sfw: string;
78
sketchy: string;

dist/config.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hoyo.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/utils/request.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default class Requested {
22
constructor();
33
private makeRequest;
4-
request(uri: string, options: Record<string, unknown>): Promise<Response>;
4+
request(uri: string, options: Record<string, unknown>, cookie?: string): Promise<Response>;
55
}

dist/utils/request.js

Lines changed: 9 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/wallpaper.d.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { AnimeSource, dataImageFormat, hoyoResult, hoyolab, searchForWallhaven, searchOpt } from "./typings";
22
export declare class AnimeWallpaper {
33
private client;
4-
private hoyo;
54
constructor();
65
/**
76
* Universal search function for all websites
@@ -28,7 +27,15 @@ export declare class AnimeWallpaper {
2827
* @param {hoyolab} params - Parameters for the Hoyolab request.
2928
* @returns {Promise<hoyoResult>} - A promise that resolves to the result of the request.
3029
*/
31-
Hoyolab(params: hoyolab): Promise<hoyoResult>;
30+
hoyolab(params: hoyolab): Promise<hoyoResult>;
31+
/**
32+
* Retrieves images from Pinterest based on a search query.
33+
*
34+
* @param {string} query - The search query to use for retrieving images.
35+
* @returns {Promise<dataImageFormat[]>} - A promise that resolves to an array of dataImageFormat objects containing information about the retrieved images.
36+
* @throws {WallError} - If the search query is empty or no images are found.
37+
*/
38+
pinterest(query: string): Promise<dataImageFormat[]>;
3239
/**
3340
* Scrapes a random anime wallpaper from free4kWallpaper.
3441
*
@@ -39,7 +46,7 @@ export declare class AnimeWallpaper {
3946
* Scraping images wallpaper from Wallpapers.com
4047
*
4148
* @param search.title the title of the anime you want to search.
42-
* @returns {dataImageFormat}
49+
* @returns {dataImageFormat} A promise that resolves to an array of dataImageFormat objects containing information about the retrieved images.
4350
*/
4451
private scrapeFromWallpapersDotCom;
4552
/**
@@ -49,14 +56,14 @@ export declare class AnimeWallpaper {
4956
* @param search.type the type or purity of image sfw or sketchy image or even both.
5057
* @param search.page the page for image you want to search, default is 1
5158
* @param search.aiArt show the ai art included if user input true or false, default is false
52-
* @returns {dataImageFormat}
59+
* @returns {dataImageFormat} A promise that resolves to an array of dataImageFormat objects containing information about the retrieved images.
5360
*/
5461
private scrapeFromWallHaven;
5562
/**
5663
* Scraping images wallpaper from zerochan
5764
*
5865
* @param search.title the title of anime that you want to search.
59-
* @returns {dataImageFormat}
66+
* @returns {dataImageFormat} A promise that resolves to an array of dataImageFormat objects containing information about the retrieved images.
6067
*/
6168
private scrapeFromZeroChan;
6269
}

0 commit comments

Comments
 (0)