An open API service indexing awesome lists of open source software.

https://github.com/ksylvest/cubesmart


https://github.com/ksylvest/cubesmart

ruby

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# CubeSmart

[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ksylvest/cubesmart/blob/main/LICENSE)
[![RubyGems](https://img.shields.io/gem/v/cubesmart)](https://rubygems.org/gems/cubesmart)
[![GitHub](https://img.shields.io/badge/github-repo-blue.svg)](https://github.com/ksylvest/cubesmart)
[![Yard](https://img.shields.io/badge/docs-site-blue.svg)](https://cubesmart.ksylvest.com)
[![CircleCI](https://img.shields.io/circleci/build/github/ksylvest/cubesmart)](https://circleci.com/gh/ksylvest/cubesmart)

A Ruby library offering both a CLI and API for scraping [CubeSmart](hhttps://www.cubesmart.com/) self-storage facilities and prices.

## Installation

```bash
gem install extrapsace
```

## Configuration

```ruby
require 'cubesmart'

CubeSmart.configure do |config|
config.user_agent = '../..' # ENV['CUBESMART_USER_AGENT']
config.timeout = 30 # ENV['CUBESMART_TIMEOUT']
config.proxy_url = 'http://user:pass@superproxy.zenrows.com:1337' # ENV['CUBESMART_PROXY_URL']
end
```

## Usage

```ruby
require 'cubesmart'

sitemap = CubeSmart::Facility.sitemap
sitemap.links.each do |link|
url = link.loc
facility = CubeSmart::Facility.fetch(url:)

puts facility.text

facility.prices.each do |price|
puts price.text
end

puts
end
```

## CLI

```bash
cubesmart crawl
```

```bash
cubesmart crawl "https://www.cubesmart.com/california-self-storage/los-angeles-self-storage/3844.html"
```