juftin / camply

camply, the campsite finder ⛺️ - a tool to find campsites at sold out campgrounds through sites like recreation.gov
https://juftin.com/camply/
MIT License
468 stars 90 forks source link

Search on Recreation.gov for permits #281

Open changlan opened 1 year ago

changlan commented 1 year ago

Description

I took a stab at #82 and #22 to add support for searching on recreation.gov for permits. Similar to campgrounds, there is a 3-level hierarchy for permits: rec-area -> facility -> permit / trails. So I (ab)use the existing cli commands with the following mapping:

Let me know if this is a good idea. I would like to collect some feedback before moving on to adding documentations, etc.

Has This Been Tested?

List facilities in a rec-area

camply --provider=RecreationDotGovPermit campgrounds --rec-area=1064
[2023-07-06 22:19:09] CAMPLY   camply, the campsite finder ⛺️                                                          
[2023-07-06 22:19:09] INFO     Using Camply Provider: "RecreationDotGovPermit"
[2023-07-06 22:19:09] INFO     Retrieving Facility Information for Recreation Area ID: `1064`.
[2023-07-06 22:19:11] INFO     3 Matching Campgrounds Found
[2023-07-06 22:19:11] INFO     ⛰  Inyo National Forest, CA (#1064) - 🏕  (Old) Mt. Whitney (Old) (#233260)
[2023-07-06 22:19:11] INFO     ⛰  Inyo National Forest, CA (#1064) - 🏕  Inyo National Forest - Wilderness Permits
                               (#233262)
[2023-07-06 22:19:11] INFO     ⛰  Inyo National Forest, USA (#1064) - 🏕  Mt. Whitney (#445860)
[2023-07-06 22:19:11] CAMPLY   Exiting camply 👋

List permits in a rec-area

camply --provider=RecreationDotGovPermit list-campsites --rec-area=2991
[2023-07-06 22:17:01] CAMPLY   camply, the campsite finder ⛺️                                                          
[2023-07-06 22:17:01] INFO     Using Camply Provider: "RecreationDotGovPermit"
[2023-07-06 22:17:01] INFO     Retrieving Facility Information for Recreation Area ID: `2991`.
[2023-07-06 22:17:03] INFO     2 Matching Campgrounds Found
[2023-07-06 22:17:03] INFO     ⛰  Yosemite National Park, CA (#2991) - 🏕  Half Dome Permits (#234652)
[2023-07-06 22:17:03] INFO     ⛰  Yosemite National Park, USA (#2991) - 🏕  Yosemite National Park Wilderness Permits
                               (#445859)
[2023-07-06 22:17:03] INFO     Searching for campsites to list
[2023-07-06 22:17:04] INFO     Found 2 campgrounds to search
[2023-07-06 22:17:04] INFO     Found 12 Campsites
[2023-07-06 22:17:04] INFO     🏕  Half Dome Permits - (#234652)
[2023-07-06 22:17:04] INFO         ⛺️ Half Dome Cables - (#31)                                                         
[2023-07-06 22:17:04] INFO     🏕  Yosemite National Park Wilderness Permits - (#445859)
[2023-07-06 22:17:04] INFO         ⛺️ Beehive Meadows - (#44585904)                                                    
[2023-07-06 22:17:04] INFO         ⛺️ Cathedral Lakes - (#44585907)                                                    
[2023-07-06 22:17:04] INFO         ⛺️ Glen Aulin - (#44585914)                                                         
[2023-07-06 22:17:04] INFO         ⛺️ Glen Aulin -> Cold Canyon/Waterwheel (pass through) - (#44585915)                
[2023-07-06 22:17:04] INFO         ⛺️ Happy Isles -> Little Yosemite Valley (No Donohue Pass) - (#44585917)
[2023-07-06 22:17:04] INFO         ⛺️ Happy Isles -> Past LYV (Donohue Pass Eligible) - (#44585918)
[2023-07-06 22:17:04] INFO         ⛺️ Lyell Canyon (Donohue Pass Eligible) - (#44585921)
[2023-07-06 22:17:04] INFO         ⛺️ May Lake - (#44585924)
[2023-07-06 22:17:04] INFO         ⛺️ Rafferty Creek -> Vogelsang - (#44585940)
[2023-07-06 22:17:04] INFO         ⛺️ Sunrise - (#44585945)
[2023-07-06 22:17:04] INFO         ⛺️ Young Lakes via Glen Trail - (#44585956)
[2023-07-06 22:17:04] CAMPLY   Exiting camply 👋

Search permits

camply --provider=RecreationDotGovPermit campsites --rec-area=2991 --campsite=44585917 --campsite=44585918 --start-date=2023-07-01 --end-date=2023-07-31 --search-forever

Checklist:

juftin commented 1 year ago

👏 nice, very exciting. I would love to have this as part of camply. I'm on a long extended trip right now, I won't be home for a couple more weeks before I can take a closer look at this. I'll try to add some questions and comments as I can in the meantime. My first reaction is that everything looks very clean. Excited to dive deeper on this.