holmes

A searching layer on top of gumbocr

Holmes

Holmes adds a searching layer on top of Gumbocr.

Installation

Add it to Projectfile

deps do
  github "zamith/holmes"
end

Usage

require "holmes"

all_with_tag

Get all the elements with a certain tag:

Holmes.parse("<p>Paragraph</p>").all_with_tag("p")

text

Gets the text for a certain node:

Holmes.parse("<p>Paragraph</p>").all_with_tag("p").first.text
# Paragraph

open

Downloads and parses an HTML document from an URL:

Holmes.open("http://rubyconf.pt").all_with_tag("p").first.text
# 14-15 September

Development

Clone and install dependencies with:

$ git clone git@github.com:zamith/gumbocr.git
$ cd gumbocr
$ crystal deps

Contributing

  1. Fork it ( https://github.com/zamith/holmes/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • Zamith Zamith - creator, maintainer
Repository

holmes

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • over 9 years ago
  • May 30, 2015
License

MIT License

Links
Synced at

Sun, 22 Dec 2024 17:11:30 GMT

Languages