google-img-scrap 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -1
- package/package.json +45 -41
- package/types/index.d.ts +95 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
### 1.0.5
|
|
4
|
+
- Added types (by christophe77)
|
|
5
|
+
|
|
3
6
|
### v1.0.4
|
|
4
7
|
|
|
5
|
-
- New option ```urlMatch```. You
|
|
8
|
+
- New option ```urlMatch```. You now get image when an url match a string (example: "cdn")
|
|
6
9
|
- New option ```filterByTitles```. Filter images by titles
|
|
7
10
|
|
|
8
11
|
### v1.0.3
|
package/package.json
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "google-img-scrap",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Scrap images from google images with a lot of options",
|
|
5
|
-
"main": "./src/google-img-scrap.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"url":
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "google-img-scrap",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Scrap images from google images with a lot of options",
|
|
5
|
+
"main": "./src/google-img-scrap.js",
|
|
6
|
+
"types": "./types/index.d.ts",
|
|
7
|
+
"directories": {
|
|
8
|
+
"test": "test"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "node ./test/test.js"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/yoannchb-pro/google-img-scrap.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"google",
|
|
19
|
+
"image",
|
|
20
|
+
"scrap",
|
|
21
|
+
"options",
|
|
22
|
+
"query",
|
|
23
|
+
"powerfull",
|
|
24
|
+
"easy",
|
|
25
|
+
"type",
|
|
26
|
+
"color",
|
|
27
|
+
"extension",
|
|
28
|
+
"filter",
|
|
29
|
+
"date",
|
|
30
|
+
"licence"
|
|
31
|
+
],
|
|
32
|
+
"author": "yoannchb",
|
|
33
|
+
"contributors": [
|
|
34
|
+
{"name":"christophe77","url":"https://github.com/christophe77"}
|
|
35
|
+
],
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/yoannchb-pro/google-img-scrap/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/yoannchb-pro/google-img-scrap#readme",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"fast-html-dom-parser": "^1.0.5",
|
|
43
|
+
"got": "^11.0.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
type Config = {
|
|
2
|
+
search: string;
|
|
3
|
+
query?: {
|
|
4
|
+
TYPE?: string;
|
|
5
|
+
DATE?: string;
|
|
6
|
+
COLOR?: string;
|
|
7
|
+
SIZE?: string;
|
|
8
|
+
LICENCE?: string;
|
|
9
|
+
EXTENSION?: string;
|
|
10
|
+
};
|
|
11
|
+
domains?: string[];
|
|
12
|
+
excludeWords?: string[];
|
|
13
|
+
custom?: string;
|
|
14
|
+
safeSearch?: boolean;
|
|
15
|
+
excludeDomains?: string[];
|
|
16
|
+
execute?: (element: FinalResult) => FinalResult;
|
|
17
|
+
filterByTitles: [string[]];
|
|
18
|
+
};
|
|
19
|
+
type FinalResult = {
|
|
20
|
+
url: string;
|
|
21
|
+
height: string;
|
|
22
|
+
width: string;
|
|
23
|
+
};
|
|
24
|
+
type Results = {
|
|
25
|
+
url: string;
|
|
26
|
+
result: FinalResult[];
|
|
27
|
+
};
|
|
28
|
+
type GoogleQuery = {
|
|
29
|
+
SIZE: {
|
|
30
|
+
LARGE: string;
|
|
31
|
+
MEDIUM: string;
|
|
32
|
+
ICON: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
COLOR: {
|
|
36
|
+
BLACK_AND_WHITE: string;
|
|
37
|
+
TRANSPARENT: string;
|
|
38
|
+
RED: string;
|
|
39
|
+
BLUE: string;
|
|
40
|
+
PURPLE: string;
|
|
41
|
+
ORANGE: string;
|
|
42
|
+
YELLOW: string;
|
|
43
|
+
GREEN: string;
|
|
44
|
+
TEAL: string;
|
|
45
|
+
PINK: string;
|
|
46
|
+
WHITE: string;
|
|
47
|
+
GRAY: string;
|
|
48
|
+
BLACK: string;
|
|
49
|
+
BROWN: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
TYPE: {
|
|
53
|
+
CLIPART: string;
|
|
54
|
+
DRAW: string;
|
|
55
|
+
GIF: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
EXTENSION: {
|
|
59
|
+
JPG: "jpg";
|
|
60
|
+
GIF: "gif";
|
|
61
|
+
BMP: "bmp";
|
|
62
|
+
PNG: "png";
|
|
63
|
+
SVG: "svg";
|
|
64
|
+
WEBP: "webp";
|
|
65
|
+
ICO: "ico";
|
|
66
|
+
RAW: "raw";
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
DATE: {
|
|
70
|
+
DAY: string;
|
|
71
|
+
WEEK: string;
|
|
72
|
+
MONTH: string;
|
|
73
|
+
YEAR: string;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
LICENCE: {
|
|
77
|
+
CREATIVE_COMMONS: string;
|
|
78
|
+
COMMERCIAL_AND_OTHER: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* GOOGLE_IMG_SCRAP
|
|
84
|
+
*
|
|
85
|
+
* @param {Config} config
|
|
86
|
+
* @returns {Results}
|
|
87
|
+
*/
|
|
88
|
+
export declare function GOOGLE_IMG_SCRAP(config: Config): Results;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* GOOGLE_QUERY
|
|
92
|
+
*
|
|
93
|
+
* @returns {GoogleQuery}
|
|
94
|
+
*/
|
|
95
|
+
export declare const GOOGLE_QUERY: GoogleQuery;
|