steam_scraper 1.1.3 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d379bbb22e112c44df52648bd591dab509c54b5e
4
- data.tar.gz: 765d9b1db394eae0ae7241beef91ad4bf82acd7b
3
+ metadata.gz: d35d39b0ec4e9ee65403d6f213f02818db2bc493
4
+ data.tar.gz: ff9f3ec8ec11b965da0a3d8cf3d958f99536af83
5
5
  SHA512:
6
- metadata.gz: 27781291f4b79d9b614742e5c4ab88e8f04c70eb0b783a83608f77e21798d0521e1e44bbe04819c5cb5788d90d699ef5300be4c7907c8e282adb590ffc1f95f7
7
- data.tar.gz: ba06bbfa1507a5b2b2a7964b5faecc7c928e2336da695ba97d0b4208a6f92ce49dcace3b3f25ad743c9b9c0bfbceeb0b75dea05d58c2dc56e2ccd828a45ec769
6
+ metadata.gz: 1c464a5c2d986221968cb6cbc1ab6ecfcab3c6e11a93a732eda686ef09722d1585e5649c6e399a53ee4486939a5c83e5c65ddcf5c87037c9bc2cf1840e91a8cd
7
+ data.tar.gz: c98b76070ddefc042c4871b328f27b6a7e416b8aaada35b451eedc16c1cfb0e4f1d475d14523b7bfa3ded45c9563c4b29e608ccd5210f9f93da2616032d6ffeb
@@ -32,9 +32,7 @@ class GameListScraper
32
32
  puts 'Scraping Page ' + page.to_s
33
33
  items_on_page = search_results(page)
34
34
  scrape_page(items_on_page)
35
- puts 'Page Complete'
36
35
  end
37
- puts 'Scraping Complete'
38
36
  @game_list
39
37
  end
40
38
 
@@ -62,7 +60,15 @@ class GameListScraper
62
60
  end
63
61
 
64
62
  def scrape_release_date(entry)
65
- Date.parse(entry.xpath(".//div[contains(@class, 'search_released')]").text)
63
+ date_node_text = entry.xpath(".//div[contains(@class, 'search_released')]").text
64
+ date = nil
65
+ begin
66
+ date = Date.parse(date_node_text)
67
+ rescue ArgumentError
68
+ puts 'Invalid date found. Probably in the future. Date set to nil'
69
+ end
70
+
71
+ date
66
72
  end
67
73
 
68
74
  def scrape_platforms(entry)
@@ -81,7 +87,8 @@ class GameListScraper
81
87
 
82
88
  def get_review_contents(entry)
83
89
  node = entry.xpath(".//span[contains(@class, 'search_review_summary')]")
84
- result = node.attribute('data-store-tooltip').value unless node.nil?
90
+ result = nil
91
+ result = node.attribute('data-store-tooltip').value unless node.empty?
85
92
 
86
93
  result
87
94
  end
@@ -15,7 +15,7 @@ class GamePageScraper
15
15
  end
16
16
 
17
17
  def scrape_game!(game, url)
18
- puts 'Scraping Page for ' + game[:name]
18
+ puts 'Scraping additional data for ' + game[:name]
19
19
  page_contents = get_page_contents(url)
20
20
  game[:metacritic] = scrape_metacritic(page_contents)
21
21
  game[:tags] = scrape_tags(page_contents)
@@ -84,6 +84,7 @@ class GamePageScraper
84
84
  spec_hash = {}
85
85
  spec_array.each do |entry|
86
86
  value_pair = entry.split(':')
87
+ next if value_pair.first.nil?
87
88
  key = value_pair.first.to_sym
88
89
  value = value_pair.last.strip
89
90
  spec_hash[key] = value
@@ -1,3 +1,3 @@
1
1
  module SteamScraper
2
- VERSION = '1.1.3'.freeze
2
+ VERSION = '1.1.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steam_scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Gardner