X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=src%2Ftest.rb;h=dcc633c5ca3e5db9590f927d9f9402566d084c38;hb=3c0d34648b6522fcd86baa485bf6008ba805f7a3;hp=9a4edba97dfbc28a270852abb88348ddc8208bc6;hpb=65b1d997960b1600d25878c78664d4d43e2b37c0;p=pompage.git
diff --git a/src/test.rb b/src/test.rb
index 9a4edba..dcc633c 100644
--- a/src/test.rb
+++ b/src/test.rb
@@ -1,8 +1,18 @@
# coding: utf-8
-html = '
'
-/ / =~ html
-url = URI.parse($1)
-p url.host
-nbRetry = 0
-p "youpla" if (nbRetry += 1) < 5
\ No newline at end of file
+# doc : http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html
+Net::HTTP.version_1_2
+
+# hack : http://arosien.blogspot.com/2007/06/increasing-rubys-netbufferedio-buffer.html
+module Net
+ class BufferedIO
+ def rbuf_fill
+ timeout(@read_timeout) { @rbuf << @io.sysread(32768) }
+ end
+ end
+end
+
+connexion = Net::HTTP::new('www.allocine.fr').start
+connexion.finish
+html = connexion.get("/film/fichefilm_gen_cfilm=120576.html").body
+p html
\ No newline at end of file
|