Module: Itest5ch::HttpMethods
- Included in:
- Board, BoardListPage, Thread
- Defined in:
- lib/itest5ch/http_methods.rb
Instance Method Summary collapse
Instance Method Details
#get_html(url, referer: nil) ⇒ String
10 11 12 13 14 15 16 |
# File 'lib/itest5ch/http_methods.rb', line 10 def get_html(url, referer: nil) = {} ["User-Agent"] = Itest5ch.config.user_agent if Itest5ch.config.user_agent ["Referer"] = referer if referer URI.parse(url).open().read end |
#get_json(url, referer: nil) ⇒ Hash
22 23 24 |
# File 'lib/itest5ch/http_methods.rb', line 22 def get_json(url, referer: nil) JSON.parse(get_html(url, referer: referer)) end |