https://github.com/ksylvest/uhaul
A Ruby library for U-Haul that crawls self-storage facilities and prices.
https://github.com/ksylvest/uhaul
ruby
Last synced: 4 months ago
JSON representation
A Ruby library for U-Haul that crawls self-storage facilities and prices.
- Host: GitHub
- URL: https://github.com/ksylvest/uhaul
- Owner: ksylvest
- License: mit
- Created: 2024-12-17T22:30:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-08T15:30:20.000Z (9 months ago)
- Last Synced: 2025-10-08T17:46:49.304Z (9 months ago)
- Topics: ruby
- Language: Ruby
- Homepage: https://uhaul.ksylvest.com/
- Size: 1.57 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# U-Haul
[](https://github.com/ksylvest/uhaul/blob/main/LICENSE)
[](https://rubygems.org/gems/uhaul)
[](https://github.com/ksylvest/uhaul)
[](https://uhaul.ksylvest.com)
[](https://circleci.com/gh/ksylvest/uhaul)
A Ruby library offering both a CLI and API for scraping [U-Haul](https://www.publicstorage.com/) self-storage facilities and prices.
## Installation
```bash
gem install uhaul
```
## Configuration
```ruby
require 'uhaul'
UHaul.configure do |config|
config.user_agent = '../..' # ENV['UHAUL_USER_AGENT']
config.timeout = 30 # ENV['UHAUL_TIMEOUT']
config.proxy_url = 'http://user:pass@superproxy.zenrows.com:1337' # ENV['UHAUL_PROXY_URL']
end
```
## Usage
```ruby
require 'uhaul'
sitemap = UHaul::Facility.sitemap
sitemap.links.each do |link|
url = link.loc
facility = UHaul::Facility.fetch(url:)
puts facility.text
facility.prices.each do |price|
puts price.text
end
puts
end
```
## CLI
```bash
uhaul crawl
```
```bash
uhaul crawl "https://www.uhaul.com/Locations/Self-Storage-near-Manchester-Township-NJ-08759/925037/"
```