This repository houses Edmonton's IFTTT applets, triggers and actions. IFTTT is a free platform that helps you do more with all your apps and devices.
IFTTT triggers cause IFTTT actions to occur. Sometimes, a value changing somewhere is a trigger. Other times, someone making changes to a Google Document triggers an action.
This triggers when the color on the High-level bridge changes.
Pulled from here. When the air index changes, IFTTT actions can be triggered.
Also pulled from here. When the air quality risk changes, IFTTT actions are triggered.
Using a trigger field for all Albertan cities, we can trigger based on the air index for the given city.
See here.
Using a trigger field for all Albertan cities, we can trigger based on the air risk for the given city.
See here.
These are deployed using Heroku.
These variables configure the application.
Variable | Description | Default value |
---|---|---|
REDIS_PORT | Redis' port | 6379 |
REDIS_HOST | Redis' host | localhost |
REDIS_PASSWORD | Redis' password | myPassword |
AIR_QUALITY_URL | The URL GoA exposes their air quality service on | https://data.environment.alberta.ca/Services/AirQualityV2/AQHIsource.svc/CommunityAQHIs |
LTB_URL | The URL we use for pulling light the bridge tweets from | https://twitrss.me/twitter_search_to_rss/?term=LighttheBridge%20from:CityofEdmonton |
MAX_RESULTS | The maximum number of logs to keep for each Redis key | 5 |
IFTTT_SERVICE_KEY | The IFTTT service key to use | REQUIRED |
If you're interested in running this on your machine, follow this guide!
Node.js | Express | Redis |
---|---|---|
This IFTTT applet makes use of Node.js. The currently recommended version to develop with is Node v9.11.1, so ensure you have that installed. We also recommend Docker for running Redis easily.
- Install your dependencies by running
npm install
. - Run
docker-compose up
to start Redis. - Run
npm run start
to run the API on port 5000. - Set the IFTTT_SERVICE_KEY environment variable
Mac OS
Run export IFTTT_SERVICE_KEY=myservicekey
Windows
PowerShell: $env:IFTTT_SERVICE_KEY="myservicekey"
(This will only persist for the current PowerShell process)
Command Prompt: setx IFTTT_SERVICE_KEY myservicekey
Note that you must include the value myservicekey
for the key IFTTT-Service-Key in the header of requests made to the service, even in local development.
We recommend using VS Code's autoattach functionality.
A rolling log object is injected into each controller. Access it using req.cache
. See the exposed functions here. Each controller should add new objects at ${route}/${uniqueId}
. Beware sharing keys between different routes, as IFTTT has a strict 1 route per trigger rule.
In the event that you find a vulnerability, please email [email protected].