David Vallner
2/14/2006 9:06:00 PM
Dna Utorok 14 Február 2006 05:19 Kev Jackson napísal:
> > harp:~ > cat a.rb
> > require "cgi"
> >
> > class ::Hash
> > def query() map{|k,v| [CGI::escape(k), CGI::escape(v)].join
> > "="}.join "&" end
> > end
> >
> > query = { "foo" => "< > &", "bar" => "http://b/a space" }
> >
> > puts query.query
> >
> >
> > harp:~ > ruby a.rb
> > foo=%3C+%3E+%26&bar=http%3A%2F%2Fb%2Fa+space
>
> 6 minutes from post to solution - is that a record?
>
> Kev
Ara's time machine is almost as good as Guido's time machine, it seems.
Oh, and someone apparently hacked up a Ruby WWW::Mechanize which is supposed
to do this.
David Vallner