https://github.com/cunningdj/recreationgovavailability
Recreation.gov Campsite Availability App
https://github.com/cunningdj/recreationgovavailability
campground campgrounds camping chrome chrome-devtools chrome-plugin es6 government-data national-park national-parks national-parks-api parks vanilla-javascript vanilla-js
Last synced: 14 days ago
JSON representation
Recreation.gov Campsite Availability App
- Host: GitHub
- URL: https://github.com/cunningdj/recreationgovavailability
- Owner: CunningDJ
- Created: 2020-05-12T03:18:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-11T23:09:32.000Z (over 3 years ago)
- Last Synced: 2025-03-24T18:46:59.941Z (about 1 month ago)
- Topics: campground, campgrounds, camping, chrome, chrome-devtools, chrome-plugin, es6, government-data, national-park, national-parks, national-parks-api, parks, vanilla-javascript, vanilla-js
- Language: JavaScript
- Homepage: https://recreation.gov
- Size: 21.5 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Recreation.gov Availability Tool
## Introduction
I built this tool one evening to help my sister see the availabile dates of all campsites
for a given campground from Recreation.gov (all state and national parks), arguments of the year and any combination of months. I then expanded it into a UI that also fetches basic data on the campground along with inputs for the campground ID, year and months for reusability. It is written entirely in vanilla JS, and is a copy-paste web app. The code is pasted into the console, and the web app with UI and fetching ability is immediately built.When a given campground and months are submitted, it fetches and aggregates all the availability data for the given months and campground from the Recreation.gov API, and visualizes the available dates per campsite in tables.
Just like any website, the campground ID and months and year can be changed and submitted, and availability data for those parameters will be fetched and visualized.
Because this fetches from the Recreation.gov API, it must be run in the Chrome Developer Tools **after** navigating to the Recreation.gov webite in order to avoid CORS errors.
## Instructions
1. Navigate to [https://recreation.gov](https://recreation.gov)
2. Open the Chrome Developer Tools (or equivalent for another browser) and open the Console tab.
3. Copy-paste [this code](/recreationGovAvailability.js) in the Console.The UI should appear. From there, you can choose what campground ID, year, and months that you want to check availability. A sample campground ID and current year are provided as starting points. Once submitted, all the available dates in the months requested will be given, along with key information about the campground.
## Possibilities
The `fetch`-specific portions of the code could be swapped out for axios and then this could be run with NodeJS (except for the HTML part) as a CLI tool for fetching this data. If you do this, be polite with the data. This tool was made for a single person to use here or there, not so that people could hammer the API with automated tools or the backend of a website.Have fun and let me know your thoughts/improvements!