https://github.com/ksylvest/publicstorage
A Ruby library for Public Storage that crawls self-storage facilities and prices.
https://github.com/ksylvest/publicstorage
ruby
Last synced: about 1 year ago
JSON representation
A Ruby library for Public Storage that crawls self-storage facilities and prices.
- Host: GitHub
- URL: https://github.com/ksylvest/publicstorage
- Owner: ksylvest
- License: mit
- Created: 2024-11-27T00:28:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-05T16:50:03.000Z (about 1 year ago)
- Last Synced: 2025-05-05T18:00:30.832Z (about 1 year ago)
- Topics: ruby
- Language: Ruby
- Homepage: https://publicstorage.ksylvest.com/
- Size: 231 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Public Storage
[](https://github.com/ksylvest/publicstorage/blob/main/LICENSE)
[](https://rubygems.org/gems/publicstorage)
[](https://github.com/ksylvest/publicstorage)
[](https://publicstorage.ksylvest.com)
[](https://circleci.com/gh/ksylvest/publicstorage)
A Ruby library offering both a CLI and API for scraping [Public Storage](https://www.publicstorage.com/) self-storage facilities and prices.
## Installation
```bash
gem install publicstorage
```
## Configuration
```ruby
require 'publicstorage'
PublicStorage.configure do |config|
config.user_agent = '../..' # ENV['PUBLICSTORAGE_USER_AGENT']
config.timeout = 30 # ENV['PUBLICSTORAGE_TIMEOUT']
end
```
## Usage
```ruby
require 'publicstorage'
sitemap = PublicStorage::Facility.sitemap
sitemap.links.each do |link|
url = link.loc
facility = PublicStorage::Facility.fetch(url:)
puts facility.text
facility.prices.each do |price|
puts price.text
end
puts
end
```
## CLI
```bash
publicstorage crawl
```
```bash
publicstorage crawl "https://www.publicstorage.com/self-storage-ca-venice/120.html"
```