File get contents -ror
From Sandoz
(Difference between revisions)
Sandoz-admin (Talk | contribs) |
Sandoz-admin (Talk | contribs) |
||
Line 2: | Line 2: | ||
html = open(url, "User-Agent" => getUseragent(), :proxy=>getProxy()) | html = open(url, "User-Agent" => getUseragent(), :proxy=>getProxy()) | ||
+ | |||
+ | |||
+ | headers = {'Accept-Encoding' => 'gzip', 'User-Agent' => 'MyDiscogsClient/1.0 +http://mydiscogsclient.org'} | ||
+ | |||
+ | check_nb_discogs_request_done() | ||
+ | response = open(url,headers) | ||
+ | response = response.read |
Latest revision as of 05:27, 14 February 2011
response = Net::HTTP.get_response(URI.parse(url)).body
html = open(url, "User-Agent" => getUseragent(), :proxy=>getProxy())
headers = {'Accept-Encoding' => 'gzip', 'User-Agent' => 'MyDiscogsClient/1.0 +http://mydiscogsclient.org'}
check_nb_discogs_request_done() response = open(url,headers) response = response.read