[Semi-OT] http connecting to netflix

M

Mike Wilson

I was poking around, thinking about creating something to manipulate my
netflix queue, but I'm having a heck of a time with this. A simple connect
yields "" instead of content.

<code>
$ irb
irb(main):001:0> require 'net/http'
=> true
irb(main):002:0> Net::HTTP::proxy("myproxy", 80).start("www.netflix.com") do
|http|
irb(main):003:1* response , = http.get("/Default")
irb(main):004:1> end
=> [#<Net::HTTPFound 302 readbody=true>, ""]
</code>

No content though. If I substitute "www.netflix.com/Default" for
"slashdot.org/index.pl", I get content. Additionally, if I do something
like

<code>
irb(main):003:1* response , = http.get("/FooBar")
</code>

I get the same response ([#<Net::HTTPFound 302 readbody=true>, ""]).

I understand that I'm dealing maybe with servlets or something, but I'm not
sure how to address them (obviously). Just thought someone might be bored
and might have an idea how to do this.

Thanks!

_________________________________________________________________
Worried about inbox overload? Get MSN Extra Storage now!
http://join.msn.com/?PAGE=features/es
 
T

Thomas Fini Hansen

I was poking around, thinking about creating something to manipulate my
netflix queue, but I'm having a heck of a time with this. A simple connect
yields "" instead of content.

<code>
$ irb
irb(main):001:0> require 'net/http'
=> true
irb(main):002:0> Net::HTTP::proxy("myproxy", 80).start("www.netflix.com")
do |http|
irb(main):003:1* response , = http.get("/Default")
irb(main):004:1> end
=> [#<Net::HTTPFound 302 readbody=true>, ""]
</code>

302 is 'temporarily moved', you're getting redirected. The Location
header should tell you where. All the 3xx responses is redirections,
permanently or otherwise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top