html-get 2.13.5 → 2.13.6

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "html-get",
3
3
  "description": "Get the HTML from any website, using prerendering when is necessary.",
4
4
  "homepage": "https://nicedoc.com/microlinkhq/html-get",
5
- "version": "2.13.5",
5
+ "version": "2.13.6",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
8
  "html-get": "bin/index.js"
@@ -29,6 +29,7 @@
29
29
  "request"
30
30
  ],
31
31
  "dependencies": {
32
+ "@kikobeats/time-span": "~1.0.2",
32
33
  "@metascraper/helpers": "~5.37.1",
33
34
  "cheerio": "~1.0.0-rc.12",
34
35
  "css-url-regex": "~4.0.0",
@@ -43,7 +44,6 @@
43
44
  "p-cancelable": "~2.1.0",
44
45
  "p-retry": "~4.6.0",
45
46
  "replace-string": "~3.1.0",
46
- "time-span": "~4.0.0",
47
47
  "top-sites": "~1.1.169",
48
48
  "write-json-file": "~4.3.0"
49
49
  },
@@ -2,25 +2,25 @@
2
2
  [
3
3
  [
4
4
  "domainWithoutSuffix",
5
- "google"
5
+ "youtube"
6
6
  ]
7
7
  ],
8
8
  [
9
9
  [
10
10
  "domainWithoutSuffix",
11
- "youtube"
11
+ "google"
12
12
  ]
13
13
  ],
14
14
  [
15
15
  [
16
16
  "domainWithoutSuffix",
17
- "wordpress"
17
+ "microsoft"
18
18
  ]
19
19
  ],
20
20
  [
21
21
  [
22
22
  "domainWithoutSuffix",
23
- "microsoft"
23
+ "wordpress"
24
24
  ]
25
25
  ],
26
26
  [
@@ -44,13 +44,13 @@
44
44
  [
45
45
  [
46
46
  "domainWithoutSuffix",
47
- "vimeo"
47
+ "github"
48
48
  ]
49
49
  ],
50
50
  [
51
51
  [
52
52
  "domainWithoutSuffix",
53
- "github"
53
+ "vimeo"
54
54
  ]
55
55
  ],
56
56
  [
@@ -62,7 +62,7 @@
62
62
  [
63
63
  [
64
64
  "domainWithoutSuffix",
65
- "nytimes"
65
+ "bbc"
66
66
  ]
67
67
  ],
68
68
  [
@@ -80,43 +80,43 @@
80
80
  [
81
81
  [
82
82
  "domainWithoutSuffix",
83
- "bbc"
83
+ "nytimes"
84
84
  ]
85
85
  ],
86
86
  [
87
87
  [
88
88
  "domainWithoutSuffix",
89
- "telegraph"
89
+ "huffingtonpost"
90
90
  ]
91
91
  ],
92
92
  [
93
93
  [
94
94
  "domainWithoutSuffix",
95
- "pinterest"
95
+ "soundcloud"
96
96
  ]
97
97
  ],
98
98
  [
99
99
  [
100
100
  "domainWithoutSuffix",
101
- "huffingtonpost"
101
+ "spotify"
102
102
  ]
103
103
  ],
104
104
  [
105
105
  [
106
106
  "domainWithoutSuffix",
107
- "soundcloud"
107
+ "pinterest"
108
108
  ]
109
109
  ],
110
110
  [
111
111
  [
112
112
  "domainWithoutSuffix",
113
- "spotify"
113
+ "telegraph"
114
114
  ]
115
115
  ],
116
116
  [
117
117
  [
118
118
  "domainWithoutSuffix",
119
- "yelp"
119
+ "techcrunch"
120
120
  ]
121
121
  ],
122
122
  [
@@ -128,13 +128,7 @@
128
128
  [
129
129
  [
130
130
  "domainWithoutSuffix",
131
- "engadget"
132
- ]
133
- ],
134
- [
135
- [
136
- "domainWithoutSuffix",
137
- "techcrunch"
131
+ "eventbrite"
138
132
  ]
139
133
  ],
140
134
  [
@@ -146,19 +140,19 @@
146
140
  [
147
141
  [
148
142
  "domainWithoutSuffix",
149
- "theverge"
143
+ "yelp"
150
144
  ]
151
145
  ],
152
146
  [
153
147
  [
154
148
  "domainWithoutSuffix",
155
- "eventbrite"
149
+ "engadget"
156
150
  ]
157
151
  ],
158
152
  [
159
153
  [
160
154
  "domainWithoutSuffix",
161
- "giphy"
155
+ "theverge"
162
156
  ]
163
157
  ],
164
158
  [
@@ -203,6 +197,12 @@
203
197
  "ghost"
204
198
  ]
205
199
  ],
200
+ [
201
+ [
202
+ "domainWithoutSuffix",
203
+ "giphy"
204
+ ]
205
+ ],
206
206
  [
207
207
  [
208
208
  "domainWithoutSuffix",
package/src/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  const { parseUrl, isMediaUrl } = require('@metascraper/helpers')
4
4
  const debug = require('debug-logfmt')('html-get')
5
+ const timeSpan = require('@kikobeats/time-span')
5
6
  const PCancelable = require('p-cancelable')
6
7
  const { AbortError } = require('p-retry')
7
8
  const htmlEncode = require('html-encode')
8
- const timeSpan = require('time-span')
9
9
  const got = require('got')
10
10
 
11
11
  const autoDomains = require('./auto-domains')
@@ -203,7 +203,7 @@ module.exports = PCancelable.fn(
203
203
  const toEncode = htmlEncode(encoding)
204
204
  const reqMode = getMode(targetUrl, { prerender })
205
205
 
206
- const time = timeSpan()
206
+ const duration = timeSpan()
207
207
 
208
208
  const promise = getContent(targetUrl, reqMode, {
209
209
  getBrowserless,
@@ -218,7 +218,7 @@ module.exports = PCancelable.fn(
218
218
 
219
219
  const { mode, ...payload } = await promise
220
220
 
221
- return Object.assign(payload, { stats: { mode, timing: time.rounded() } })
221
+ return Object.assign(payload, { stats: { mode, timing: duration() } })
222
222
  }
223
223
  )
224
224