This script defines two types of responses, HTML and JSON.
Those requests produce JSON replies, depending on the individual field requested. Both the client and server scripts in this example involve DOM traversal. One uses JQuery style methods (
find). The other nokogiri (
An alternative to opal-jquery is opal-browser. The latter provides a more Markaby/Nokogiri style interface to the DOM.
gem install wunderbar nokogumbo opal opal-jquery sourcify ruby watch.rb --port=3030
If your web server is set up to handle CGI, you can drop this script directly into your document directory and run it. If you do so, the requests will all be handled in parallel.