FIX qques bugs...
[pompage.git] / src / test.rb
1 # coding: utf-8
2
3 # doc : http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html
4 Net::HTTP.version_1_2
5
6 # hack : http://arosien.blogspot.com/2007/06/increasing-rubys-netbufferedio-buffer.html
7 module Net
8 class BufferedIO
9 def rbuf_fill
10 timeout(@read_timeout) { @rbuf << @io.sysread(32768) }
11 end
12 end
13 end
14
15 connexion = Net::HTTP::new('www.allocine.fr').start
16 connexion.finish
17 html = connexion.get("/film/fichefilm_gen_cfilm=120576.html").body
18 p html