Project

cacho

0.0
No commit activity in last 3 years
No release in over 3 years
A careless caching client optimized for scraping.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Cacho

A careless caching client optimized for scraping.

Description

Cacho is an HTTP client for scraping. It will do most of the things you want when scraping:

  • Follow redirects.
  • Set the User-Agent to a browser-like string.
  • Accept and process gzip encoding.
  • Detect when it's been rate limited and wait.
  • Retry on silly network errors.
  • Use persistent HTTP connections.

Most importantly, Cacho will store responses on disk so that multiple runs of your script will not hit the endpoints you are scraping. This prevents being rate limited and also makes your script faster every time.

Usage

require "cacho"

client = Cacho.new

res = client.request(:get, "https://news.ycombinator.com")

Installation

$ gem install cacho

License

See the UNLICENSE.