From: Alex Amat Date: 2005-12-08T00:00:10+09:00 Subject: Re: Switch User Agent Sorry mate I meant User Agent (I'm a bit new to the world of ruby and internet) What I'm doing is a web site that changes normal PC websites into MCS sites I've got three ifreams so that the rendered sites can be previewed, all I need to do is change the user agent of the request object so that my application delivers the content for different user agents. Thanks a lot ! gene.tani wrote: > Gene Tani wrote: >> I haven't seent the term UAproof before, but the open-uri and Net::HTTP >> ways of opening URLs are both dict-like as far as passing User-Agents >> etc: >> >> http://www.ruby-doc.org/stdlib/libdoc/open-uri/rdoc/ >> >> e.g. >> Net::HTTP.start( 'www.digg.com', 80 ) do |http| >> print( http.get( '/', "User-Agent" => "foobar" ).body ) ; end >> >> setting referrer/referer (can't remember which is correct!) is similar > > whoops, forgot the great zenspider slides: > http://www.zenspider.com/dl/rubyconf2005/open-uri.pdf -- Posted via http://www.ruby-forum.com/.