Clickmap
Simple clickmap for html content. This gem assumes that you are passing valid HTML content and an array of hashes with the links (regex) to match and the number of clicks
Installation
Add this line to your application's Gemfile:
gem 'clickmap'
And then execute:
$ bundle
Or install it yourself as:
$ gem install clickmap
Usage
Clickmap.new(html_string, array_of_links[, extras_options])
For example
html = "<html><head></head><body><a href='www.test.com'>test</a></body></html>"
array_of_links = [
{ url: /www.test.com/, count: 12 }
]
= { css_class: 'my_custom_class'}
puts Clickmap.new(html_string, array_of_links, ).generate
# <html><head></head><body><a href='www.test.com' data-clickmap-count=12 class="clickmap-link my_custom_class">test</a></body></html>
Contributing
- Fork it ( http://github.com/
/clickmap/fork ) - Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request