Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I need to inteface to a few websites that use Socket.IO for data transport between their backend Node.JS server and the client's browser. I need to log all chat messages and sometimes send responses to the server. The websites use SSL so I can't use a proxy to intercept the messages, and they also don't permit multiple logins, so I can't use a separate program to do the automation if I want to interact with the website with my browser at the same time.
This is a much simpler Socket.IO chat example similar to the the websites which I have to interface to: https://node-yapp.rhcloud.com/. So for this example I'd want to capture the data argument from the addMessage function.
I'm looking for a way to use WWW::Mechanize::Firefox to automate this, but none of the available examples resemble this use case. There is an example that listens for progress events, but I don't think I can use that here.
The only other solution I can figure out is to use Greasemonkey to wrap the target javascript function inside my own function that would then post the data with GM_xmlhttpRequest to a local webserver which would write it to the logfile and return any data that should be sent back to the website's server. This seems like a more complicated solution so I am hoping somebody can suggest a simpler solution with WWW::Mechanize::Firefox, MozRepl::RemoteObject, or something I haven't even thought of.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Listening for Socket.IO events with WWW::Mechanize::Firefox
by Corion (Patriarch) on Jan 02, 2013 at 09:25 UTC | |
Re: Listening for Socket.IO events with WWW::Mechanize::Firefox
by Anonymous Monk on Jan 02, 2013 at 06:39 UTC |