ask-web-fetch 0.6.0 → 0.6.1

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: ac8355feef3bd62bc048223f0390f79d95506f084817853a1a572be5eff4a78a
4
- data.tar.gz: ccee31246284b6236732984c5f1d32fcf54d6ffa9203fa1f51150300b4b50702
3
+ metadata.gz: 15d4465ae7ca7805003043af5b97e96ddc8c2ba19618daab313377f4a529bd54
4
+ data.tar.gz: 9f83f8c2258dc973457158e7d7e2288afc43403221453545a4d19c97440b85ee
5
5
  SHA512:
6
- metadata.gz: 181316376680bbb70d193b46dd898f48547b1846726e2d5f3d0596080ed4b41ca37ae818e3bc2963e0e2e700b47ff8a2957420222c0a737e45acedd00318e68c
7
- data.tar.gz: 0b039ee976010c65274c956a3f5e3182164128b6a096eae1161ea42f266004fdd878dde12378899d68a29f26b56c2f454344e32abbd65d0444367f8948e330de
6
+ metadata.gz: b34dfd5f3d45b827cf8882d3c9c3b47e05ea8c16622849b2a41fc51b8c5f005f0b149ef83a87db57f4167470e85911ec58f72830afded9a84ab707ea08dcbc68
7
+ data.tar.gz: c8245c574d480179cd3b8ad67f1049b096fdf298f0886a790cb557f698c11e8dbaed9bb4336de4ccf84882e03eb8cf716830db069988f310c35cf4202cf01d60
@@ -55,6 +55,12 @@ module Ask
55
55
  raise FetchError, "challenge page at #{url}" if challenge_page?(body)
56
56
 
57
57
  page = to_page(body, url)
58
+ # A registrar parking page renders fine in headless Chrome too —
59
+ # the shared detector (0.5.7) catches the text markers that
60
+ # survive conversion, so the ad is rejected, not returned as
61
+ # the site's content. Crawl4AI leads the default chain, so this
62
+ # check is what keeps parked domains out of every result.
63
+ raise ParkedDomainError, "parked domain at #{url} — registrar parking page, not site content" if parked_domain?(page[:content])
58
64
  raise EmptyContentError, "no readable content at #{url}" unless usable_content?(page[:content])
59
65
 
60
66
  page
@@ -39,8 +39,13 @@ module Ask
39
39
  # links, resolved against the requested URL. Content runs
40
40
  # through the same Markdown.clean as the converting backends,
41
41
  # so decorative symbol noise is stripped here too; a page
42
- # whose only "content" was noise falls through as empty.
42
+ # whose only "content" was noise falls through as empty. A
43
+ # registrar parking page renders fine through Jina — the
44
+ # shared detector (0.5.7) catches the text markers that
45
+ # survive conversion, so the ad is rejected, not returned as
46
+ # the site's content.
43
47
  content = Markdown.clean(body)
48
+ raise ParkedDomainError, "parked domain at #{url} — registrar parking page, not site content" if parked_domain?(content)
44
49
  raise EmptyContentError, 'empty response from Jina' unless usable_content?(content)
45
50
 
46
51
  { title: nil, description: nil, content: content, outlinks: markdown_outlinks(body, url) }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module WebFetch
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-web-fetch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto