From: Meihua Liang Date: 2004-01-31T06:24:57+09:00 Subject: Re: Net::http.get has a 50K limit? I tried your suggestion (ie. using a block and putting it to a file: see copy below) but it still cuts the page short just as before. The actual web page is ~58K but I'm only getting ~51K. Any more suggestions? require "net/http" # using block Net::HTTP.start("www.washingtonpost.com", 80){ |http| File.open('result.txt', 'wb+') {|f| resp,=http.get('/wl/jobs/JS_JobSearch?TS=1012409733026',nil) { |str| f.print( str ) } } } "Vivek Nallur" wrote in message news:Pine.WNT.4.58.0401301052560.536@Vajra.CDACMUMBAI.CDACINDIA.COM... > Just a small change required. > > |require "net/http" > |begin > | Net::HTTP.start("www.washingtonpost.com", 80){ |http| > | response , = http.get("/wl/jobs/JS_JobSearch?TS=1012409733026") > > File.open("/some/file/","wb+"){|f| > resp, = http.get(url, nil){|gotit| > f.print(gotit) > } > } > > > | data=response.body > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > The data is not part of the response any more. This behaviour has changed > from ruby 1.6 > > regs > Vivek > > > | puts data.length > | } > |rescue => err > | puts "Error: #{err}" > | exit > |end > | > |The last line returns 52166 . (the file is considerable bigger) What did I > |do wrong? > | > | > | > | > > -- > > Accept that some days you are the pigeon and some days the statue > > >