Public Storage

A Ruby library offering both a CLI and API for scraping Public Storage self-storage facilities and prices.

Installation

gem install publicstorage

Configuration

require 'publicstorage'

PublicStorage.configure do |config|
  config.user_agent = '../..' # ENV['PUBLICSTORAGE_USER_AGENT']
  config.timeout = 30 # ENV['PUBLICSTORAGE_TIMEOUT']
end

Usage

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

publicstorage crawl
publicstorage crawl "https://www.publicstorage.com/self-storage-ca-venice/120.html"