Undead

Undead gets Dynamic HTML. Dynamic HTML are created by JavaScript.

Installation

Add this line to your application's Gemfile:

gem 'undead'

And then execute:

$ bundle

Or install it yourself as:

$ gem install undead

Usage

Get Dynamic HTML in Terminal

$ undead http://example.com/

Get Dynamic HTML in Ruby

Undead.get can get Dynamic HTML. <script> is evaluated, then HTML is created.

response = Undead.get 'http://example.com/'  # GET http://example.com/

# Undead's response. The HTML p element is dynamicaly created.
# <!doctype html>
# <html>
# <head></head>
# <body>
#   <div id="main">
#     <p>Hello, World!</p>
#   </div>
#   <script>
#     var p = document.createElement("p");
#     var helloText = document.createTextNode("Hello, World!");
#     p.appendChild(helloText);
#     var main = document.getElementById("main");
#     main.appendChild(p);
#   </script>
# </body>

# Original response.
# <!doctype html>
# <html>
# <head></head>
# <body>
#   <div id="main"></div>
#   <script>
#     var p = document.createElement("p");
#     var helloText = document.createTextNode("Hello, World!");
#     p.appendChild(helloText);
#     var main = document.getElementById("main");
#     main.appendChild(p);
#   </script>
# </body>

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/south37/undead.

License

The gem is available as open source under the terms of the MIT License.