From 13aab8498a0a2d4494a088f1235a0e80c078bdcf Mon Sep 17 00:00:00 2001
From: Kelly Rauchenberger <fefferburbia@gmail.com>
Date: Fri, 2 Mar 2018 18:49:58 -0500
Subject: Fixed scraping of images from age-restricted games

---
 scrape.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scrape.rb b/scrape.rb
index dfeb356..8ba4b68 100644
--- a/scrape.rb
+++ b/scrape.rb
@@ -91,8 +91,11 @@ def scrape_profile(profile, full)
           game = Game.new(steam_appid: id, color: MOON_COLORS[moon_index])
           game.save
 
+          # The cookie is required for games that have an age restriction
           storepage = Nokogiri::HTML(
-            open("http://store.steampowered.com/app/#{id}"))
+            open(
+              "http://store.steampowered.com/app/#{id}",
+              "Cookie" => 'birthtime=126248401'))
 
           img_id = 0
           storepage.css(".highlight_screenshot_link").each do |node|
-- 
cgit 1.4.1