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
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
Get all the libraries installed
$ pip install
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.
Inser your search criteria in the /camping/defaults/main.yml
file.
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
}
]
Self explanatory
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.
Yes, the message can be customized in /templates/message.j2
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.