html-get 2.13.4 → 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.4",
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
  },
@@ -14,13 +14,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,19 +44,19 @@
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
  [
57
57
  [
58
58
  "domainWithoutSuffix",
59
- "theguardian"
59
+ "imdb"
60
60
  ]
61
61
  ],
62
62
  [
@@ -68,79 +68,79 @@
68
68
  [
69
69
  [
70
70
  "domainWithoutSuffix",
71
- "nytimes"
71
+ "slideshare"
72
72
  ]
73
73
  ],
74
74
  [
75
75
  [
76
76
  "domainWithoutSuffix",
77
- "imdb"
77
+ "theguardian"
78
78
  ]
79
79
  ],
80
80
  [
81
81
  [
82
82
  "domainWithoutSuffix",
83
- "slideshare"
83
+ "nytimes"
84
84
  ]
85
85
  ],
86
86
  [
87
87
  [
88
88
  "domainWithoutSuffix",
89
- "spotify"
89
+ "huffingtonpost"
90
90
  ]
91
91
  ],
92
92
  [
93
93
  [
94
94
  "domainWithoutSuffix",
95
- "huffingtonpost"
95
+ "soundcloud"
96
96
  ]
97
97
  ],
98
98
  [
99
99
  [
100
100
  "domainWithoutSuffix",
101
- "soundcloud"
101
+ "spotify"
102
102
  ]
103
103
  ],
104
104
  [
105
105
  [
106
106
  "domainWithoutSuffix",
107
- "telegraph"
107
+ "pinterest"
108
108
  ]
109
109
  ],
110
110
  [
111
111
  [
112
112
  "domainWithoutSuffix",
113
- "pinterest"
113
+ "telegraph"
114
114
  ]
115
115
  ],
116
116
  [
117
117
  [
118
118
  "domainWithoutSuffix",
119
- "yelp"
119
+ "techcrunch"
120
120
  ]
121
121
  ],
122
122
  [
123
123
  [
124
124
  "domainWithoutSuffix",
125
- "eventbrite"
125
+ "zoom"
126
126
  ]
127
127
  ],
128
128
  [
129
129
  [
130
- "domain",
131
- "abc.net.au"
130
+ "domainWithoutSuffix",
131
+ "eventbrite"
132
132
  ]
133
133
  ],
134
134
  [
135
135
  [
136
- "domainWithoutSuffix",
137
- "zoom"
136
+ "domain",
137
+ "abc.net.au"
138
138
  ]
139
139
  ],
140
140
  [
141
141
  [
142
142
  "domainWithoutSuffix",
143
- "techcrunch"
143
+ "yelp"
144
144
  ]
145
145
  ],
146
146
  [
@@ -158,25 +158,25 @@
158
158
  [
159
159
  [
160
160
  "domainWithoutSuffix",
161
- "digg"
161
+ "etsy"
162
162
  ]
163
163
  ],
164
164
  [
165
165
  [
166
166
  "domainWithoutSuffix",
167
- "giphy"
167
+ "csdn"
168
168
  ]
169
169
  ],
170
170
  [
171
171
  [
172
172
  "domainWithoutSuffix",
173
- "csdn"
173
+ "deviantart"
174
174
  ]
175
175
  ],
176
176
  [
177
177
  [
178
178
  "domainWithoutSuffix",
179
- "deviantart"
179
+ "digg"
180
180
  ]
181
181
  ],
182
182
  [
@@ -188,19 +188,19 @@
188
188
  [
189
189
  [
190
190
  "domainWithoutSuffix",
191
- "etsy"
191
+ "flickr"
192
192
  ]
193
193
  ],
194
194
  [
195
195
  [
196
196
  "domainWithoutSuffix",
197
- "flickr"
197
+ "ghost"
198
198
  ]
199
199
  ],
200
200
  [
201
201
  [
202
202
  "domainWithoutSuffix",
203
- "ghost"
203
+ "giphy"
204
204
  ]
205
205
  ],
206
206
  [
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