From: Ryan Davis Date: 2012-09-08T15:50:23+09:00 Subject: Re: OpenURI open method problem On Sep 7, 2012, at 21:26 , 7stud -- wrote: >> Still, the op's question remains unanswered: why doesn't open-uri follow >> all those redirects? > >>> it can: > > According to the docs, open-uri follows redirects by default. So > according to the docs, open-uri can follow redirects, but the fact > remains it doesn't in this case. Why? Because it redirects with invalid URI's: Last login: Fri Sep 7 23:45:55 on ttys008 10000 % ruby -ropen-uri -e 'URI.parse(ARGV.shift).read' "http://www.jdoqocy.com/click-5329913-10538037?url=http://www.6pm.com/rock-n-roll-cowgirl-woven-tunic-red" /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not URI?): http://www.apmebf.com/l8122ar-zH/ry2/GFKINFIM/KIHOOGI/F/F/F?b=k1ys%3Do00w%25AH%259M%259M333.Dwt.jvt%259Myvjr-u-yvss-jv3npys-3v2lu-01upj-ylk<