Aaron Patterson
2007-Jul-24 12:26 UTC
[Mechanize-users] Jruby + Rhino = Javascript support?
On Tue, Jul 24, 2007 at 11:15:49AM -0400, Mat Schaffer wrote:> Hey Aaron, I''m just thinking out loud here, but have you considered > the possibility of using the Rhino [1] library to implement > javascript support in mechanize? It''d create a jruby dependency for > that feature, but still. Just thought I''d bring it up while I was > thinking about it.Yes, definitely. I''ve been thinking (and working) on a javascript solution for a while. I haven''t played around with Rhino though... Basically what I''ve been working on is a way to convert Javascript to ruby. Then I can just eval the converted JS. You can check out what I''ve done so far here: http://rubyforge.org/projects/rkelly/ I''ve also got a copy of mechanize on my laptop with RKelly integrated, and it works with simple javascript (including setting form values!). Unfortunately I''ve been really busy lately so I haven''t been able to pay attention to RKelly as much as I''d like. Also here is a short example of what it can do so far: http://tenderlovemaking.com/2007/05/22/more-ecma-awesomeness/ -- Aaron Patterson http://tenderlovemaking.com/
Hey Aaron, I''m just thinking out loud here, but have you considered the possibility of using the Rhino [1] library to implement javascript support in mechanize? It''d create a jruby dependency for that feature, but still. Just thought I''d bring it up while I was thinking about it. -Mat [1] http://www.mozilla.org/rhino/
This makes me wonder if its possible to call javascript functions. For example, I have a web page that when you type data, it retrieves the data for the next field with javascript. I was wondering if I could just "submit" this request directly. Currently how does one do these sorts of things, or is rkelly the kind of thing that could make that happen? Mike B. Quoting Aaron Patterson <aaron at tenderlovemaking.com>:> On Tue, Jul 24, 2007 at 11:15:49AM -0400, Mat Schaffer wrote: >> Hey Aaron, I''m just thinking out loud here, but have you considered >> the possibility of using the Rhino [1] library to implement >> javascript support in mechanize? It''d create a jruby dependency for >> that feature, but still. Just thought I''d bring it up while I was >> thinking about it. > > Yes, definitely. I''ve been thinking (and working) on a javascript > solution for a while. I haven''t played around with Rhino though... > Basically what I''ve been working on is a way to convert Javascript to > ruby. Then I can just eval the converted JS. > > You can check out what I''ve done so far here: > > http://rubyforge.org/projects/rkelly/ > > I''ve also got a copy of mechanize on my laptop with RKelly integrated, > and it works with simple javascript (including setting form values!). > Unfortunately I''ve been really busy lately so I haven''t been able to pay > attention to RKelly as much as I''d like. Also here is a short example > of what it can do so far: > > http://tenderlovemaking.com/2007/05/22/more-ecma-awesomeness/ > > -- > Aaron Patterson > http://tenderlovemaking.com/ > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
On Jul 24, 2007, at 8:26 AM, Aaron Patterson wrote:> Yes, definitely. I''ve been thinking (and working) on a javascript > solution for a while. I haven''t played around with Rhino though... > Basically what I''ve been working on is a way to convert Javascript to > ruby. Then I can just eval the converted JS. > > You can check out what I''ve done so far here: > > http://rubyforge.org/projects/rkelly/As cool as this is, I can''t get past the fact that you named a ruby project rkelly. I''ll have to think about this more once the mental shock settles :-P -Mat