https://github.com/ksylvest/extraspace
A Ruby library for Extra Space that crawls self-storage facilities and prices.
https://github.com/ksylvest/extraspace
ruby
Last synced: 4 months ago
JSON representation
A Ruby library for Extra Space that crawls self-storage facilities and prices.
- Host: GitHub
- URL: https://github.com/ksylvest/extraspace
- Owner: ksylvest
- License: mit
- Created: 2024-11-20T23:27:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-21T07:32:05.000Z (over 1 year ago)
- Last Synced: 2025-01-21T08:26:10.274Z (over 1 year ago)
- Topics: ruby
- Language: Ruby
- Homepage: https://extraspace.ksylvest.com
- Size: 288 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Extra Space
[](https://github.com/ksylvest/extraspace/blob/main/LICENSE)
[](https://rubygems.org/gems/extraspace)
[](https://github.com/ksylvest/extraspace)
[](https://extraspace.ksylvest.com)
[](https://circleci.com/gh/ksylvest/extraspace)
A Ruby library offering both a CLI and API for scraping [Extra Space](https://www.extraspace.com/) self-storage facilities and prices.
## Installation
```bash
gem install extraspace
```
## Configuration
```ruby
require 'extraspace'
ExtraSpace.configure do |config|
config.user_agent = '../..' # ENV['EXTRASPACE_USER_AGENT']
config.timeout = 30 # ENV['EXTRASPACE_TIMEOUT']
end
```
## Usage
```ruby
require 'extraspace'
sitemap = ExtraSpace::Facility.sitemap
sitemap.links.each do |link|
url = link.loc
facility = ExtraSpace::Facility.fetch(url:)
puts facility.text
facility.prices.each do |price|
puts price.text
end
puts
end
```
## CLI
```bash
extraspace crawl
```
```bash
extraspace crawl "https://www.extraspace.com/storage/facilities/us/california/los_angeles/900113/"
```