module SpecsWatcher::Requests
Protected Instance Methods
base_uri()
click to toggle source
# File lib/specs_watcher/requests.rb, line 7 def base_uri "http://www.specsonline.com/cgi-bin" end
headers()
click to toggle source
# File lib/specs_watcher/requests.rb, line 19 def headers { 'DNT' => '1', 'Accept-Language' => 'en-US,en;q=0.8', 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36', 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Referer' => 'http://www.specsonline.com/cgi-bin/search?keyword=&inclass=Liquors&webclass=Liquors&subclass=130&origin=®ion=&size=&Sortby=Name&pricefrom=&pricethru=&', 'Connection' => 'keep-alive' } end
make_request(path, params = {})
click to toggle source
# File lib/specs_watcher/requests.rb, line 11 def make_request(path, params = {}) Typhoeus.get(base_uri + path, method: :get, params: params, headers: headers, accept_encoding: 'gzip') end