<commit_before># Wombat

[![CI Build Status](https://secure.travis-ci.org/intridea/omniauth.png?branch=master)](http://travis-ci.org/felipecsl/wombat)

Generic Web crawler with a DSL that parses event-related data from web pages.

Still under heavy development, it is being rewritten from scratch as a gem from an already existing project.

## Contributing to Wombat
 
 * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
 * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
 * Fork the project
 * Start a feature/bugfix branch
 * Commit and push until you are happy with your contribution
 * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
 * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

## Copyright

Copyright (c) 2011 <NAME>. See LICENSE.txt for further details.
<commit_msg>updating readme and adding sample usage<commit_after># Wombat

[![CI Build Status](https://secure.travis-ci.org/intridea/omniauth.png?branch=master)](http://travis-ci.org/felipecsl/wombat)

Generic Web crawler with a DSL that parses structured data from web pages.

## Usage:

``gem install wombat``

```ruby

# => github_crawler.rb

#coding: utf-8
require 'wombat'

class GithubCrawler
  include Wombat::Crawler

  base_url "http://www.github.com"
  list_page "/"

  headline "xpath=//h1"

  benefits do |b|
    b.first_benefit "css=.column.leftmost h3"
    b.second_benefir "css=.column.leftmid h3"
    b.third_benefit "css=.column.rightmid h3"
    b.fourth_benefit "css=.column.rightmost h3"
  end
end
```
```ruby
irb> SampleCrawler.new.crawl
   => 
   {
      "headline" => "1,316,633 people hosting over 3,951,378 git repositories", 
      "benefits" => {
        "first_benefit"  => "Team management", 
        "second_benefit" => "Code review", 
        "third_benefit"  => "Reliable code hosting", 
        "fourth_benefit" => "Open source collaboration"
      }
    }
```

### More advanced constructs like loops, following links, callbacks, etc. to be added/documented soon.


## Contributing to Wombat
 
 * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
 * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
 * Fork the project
 * Start a feature/bugfix branch
 * Commit and push until you are happy with your contribution
 * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
 * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

## Copyright

Copyright (c) 2011 <NAME>. See LICENSE.txt for further details.

{'fraction_non_alphanumeric': 0.0869281045751634, 'fraction_numerical': 0.009150326797385621, 'mean_word_length': 3.82807570977918, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1233538', 'n_tokens_mistral': 962, 'n_tokens_neox': 887, 'n_words': 384}