Skip to content

Provide notifications about free campsites using an ansible playbook and twilio

Notifications You must be signed in to change notification settings

colincalnan/ansible-camping-notification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

This is an Ansible playbook that can be used to send SMS notifications when a site becomes avaiable in a BC Campground of your choosing.

Inspired by: http://campalert.live/

Built with help from: https://github.com/hugsy/stuff/blob/ad6a345ab9e739d76cf5e6be3c0690ce23a298f1/bc_camping.py

How does it work?

It's an ansible playbook, so you'll need ansible. It could be imported into AWX and run on a schedule also.

$ ansible-playbook camping.yml

Step 1 - Install

Get all the libraries installed

$ pip install

Step 2 - Credentials

Insert your Twilio account_sid and auth_token in the /camping/defaults/main.yml. You'll need a Twilio account with a purchased phone number.

Step 3 - Set up your search criteria

Inser your search criteria in the /camping/defaults/main.yml file.

campsites

Add your campground ID's, you can get these from the camping API at https://bccrdr.usedirect.com

For example searching for Bear Creek

curl --request GET \
  --url https://bccrdr.usedirect.com/rdr/rdr/fd/citypark/namecontains/Bear

This returns an object - PlaceId is the ID you want

[
  {
    "CityParkId": 7,
    "Name": "Bear Creek",
    "Latitude": 49.928836,
    "Longitude": -119.516802,
    "IsActive": true,
    "EntityType": "Park",
    "EnterpriseId": 1,
    "ParkSize": "Medium",
    "PlaceId": 7
  }
]

number_of_nights

Self explanatory

What about the dates?

The date is hardcoded to today's date in the bccrdr.usedirect.combody.json.j2` file. You could modify it there or else add a new variable.

Can I customize the message?

Yes, the message can be customized in /templates/message.j2

What's the bc_camping.py file for

That was where the original inspiration came from and I tinkered with it a little to get it working. I've left it here so you can play with it also.

About

Provide notifications about free campsites using an ansible playbook and twilio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published