ask-web-fetch 0.5.8 → 0.5.9
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8f3dc79c573c21dc567f86edd621ad84da98437ef512faea0e13b36219670d2
|
|
4
|
+
data.tar.gz: 694519194d63c9f4066f943ed2fe472f029ea10afd6e423a41440ff7d8a04964
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 270301527344d9b49c982e1d7c27dd83117f23c56de3e321f67e15aae7696998d423bd7cec72852a188412ee54b4183736917a5ec6c7030eab888b621af611f1
|
|
7
|
+
data.tar.gz: 66933232dbb0f106362e2a9552f19fc152022c5f9ed9b7ca4bda6fe1d2b3935ce3a3b7288bc2d0130aa8d9bddd6a4e5861ff5ed675e11b763b0e0d171e5749ef
|
|
@@ -16,6 +16,13 @@ module Ask
|
|
|
16
16
|
# A backend that fetched the page but found nothing usable in it.
|
|
17
17
|
class EmptyContentError < Error; end
|
|
18
18
|
|
|
19
|
+
# A backend that fetched a REGISTRAR PARKING PAGE — an ad for a
|
|
20
|
+
# parked (for-sale) domain, not the site's content. Deterministic and
|
|
21
|
+
# terminal: retrying will never turn a parking ad into content, so
|
|
22
|
+
# the pipeline must classify (not retry) it. A subclass of
|
|
23
|
+
# EmptyContentError so existing empty-content handling still applies.
|
|
24
|
+
class ParkedDomainError < EmptyContentError; end
|
|
25
|
+
|
|
19
26
|
# Network-level failure — timeout, connection refused/reset, bad
|
|
20
27
|
# socket. Transient: the same URL may succeed on retry.
|
|
21
28
|
class TimeoutError < Error; end
|
|
@@ -201,8 +201,9 @@ module Ask
|
|
|
201
201
|
end
|
|
202
202
|
# Browser renders the parked page a JS redirect lands on (the
|
|
203
203
|
# server shell hands /lander to JS) — Local never sees it. The
|
|
204
|
-
# shared parked-domain detector catches it here
|
|
205
|
-
|
|
204
|
+
# shared parked-domain detector catches it here; the distinct
|
|
205
|
+
# ParkedDomainError lets the pipeline classify (never retry) it.
|
|
206
|
+
raise ParkedDomainError, "parked domain at #{url} — registrar parking page, not site content" if parked_domain?(body)
|
|
206
207
|
|
|
207
208
|
result = Markdown.generate(body, base_url: url, filter: self.class.content_filter)
|
|
208
209
|
result[:outlinks] = outlink_urls(body, url)
|
|
@@ -55,7 +55,7 @@ module Ask
|
|
|
55
55
|
# parked pages are fully server-rendered, so both Local and
|
|
56
56
|
# Browser see the same ad.
|
|
57
57
|
if parked_domain?(body)
|
|
58
|
-
raise
|
|
58
|
+
raise ParkedDomainError, "parked domain at #{url} — registrar parking page, not site content"
|
|
59
59
|
end
|
|
60
60
|
raise EmptyContentError, "no readable content at #{url}" unless usable_content?(page[:content])
|
|
61
61
|
# The completeness signal: a JS-app shell whose server HTML
|