Project

botch

0.0
No commit activity in last 3 years
No release in over 3 years
Botch is a DSL for quickly creating web crawlers. Inspired by Sinatra.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

 Project Readme

Botch

Build Status

Botch is a simple DSL for quickly creating web crawlers.

Inspired by Sinatra.

Japanese

Installation

add this line to your Gemfile.

gem 'botch'

or

$ gem install botch

Usage

require 'lib/botch'
require 'kconv'
require 'rack'

class SampleBotch < Botch::Base
  set :user_agent, "SampleBotch"

  helpers do
    def h(str)
      Rack::Utils.escape_html(str)
    end
  end

  filter :example, :map => "example.com" do
    status == 200
  end

  rule :example, :map => /example\.com/ do
    h(body.toutf8)
  end
end

if $0 == __FILE__
  SampleBotch.run("http://example.com/") do |response|
    puts response
  end
end

TODO

  • RSpec
  • Documentation

Contributing to Botch

  1. fork the project.
  2. create your feature branch. (git checkout -b my-feature)
  3. commit your changes. (git commit -am 'commit message.')
  4. push to the branch. (git push origin my-feature)
  5. send pull request.

License

MIT