grucrawler 0.0.3 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed98643e2c2212bb044726cf3dda3af19a06ba8d
4
- data.tar.gz: 70fadbce9333a32831ba5c5150916cecfeda5bf6
3
+ metadata.gz: 2f9257639bf846e766fbbba96ff192b70eb787f5
4
+ data.tar.gz: 761f391b0f3015b67acfef7d2dda40160f58859e
5
5
  SHA512:
6
- metadata.gz: 778c8ae783b46a8cb82448156da1741c4780d10148a673702071fe53ff896e587106dc66c54df52c642b8f29d5d69d16060cd20e2f6df466c6deece3cf0d8a0f
7
- data.tar.gz: fcfb89156687d864a66f955d9c309b5ccbc0b2cd0a88a4b94802a1d5cab52d34399f73071f1783ca930f4df510e5dba617d25e30272d5d257c4e8dc522eb2f87
6
+ metadata.gz: b92f0d90252eacca1c0125035678fa93a5f4cdd35f8ea8eab38212e570a211e9136616a725d834fe0af1b64e0b2cd3c61e6c1cdd751b81f387d36417c509fd1e
7
+ data.tar.gz: 6263c707c3838423916716e45231391f087ab67fb826661f0e57ba20aae9a04610b9a387301b8f968b8bede8097470493d014f68df668659614b0ebb50cf95b0
data/README.md CHANGED
@@ -29,6 +29,8 @@ class ItalianCrawler
29
29
  end
30
30
 
31
31
  def follow_link(target_url, typhoeus_response, nokogiri_html)
32
+ return false if target_url.match(/\.(jpg|png|js|css|pdf|exe|dmg|zip|doc|rtf|rar|swf|bmp|swf|mp3|wav|mp4|mpg|flv|wma)$/)
33
+
32
34
  return true if target_url.include? '.it'
33
35
 
34
36
  false
@@ -113,7 +113,9 @@ class GruCrawler
113
113
  return nil if uri.host.nil?
114
114
  host = uri.host.downcase
115
115
  host = host.start_with?('www.') ? host[4..-1] : host
116
- host.match(/\w+\.\w+$/)[0]
116
+ match = [host.match(/\w+\.\w+$/)]
117
+ return nil unless match
118
+ match[0]
117
119
  end
118
120
  end
119
121
  end
@@ -1,3 +1,3 @@
1
1
  class GruCrawler
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grucrawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slava Vishnyakov