-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding ifttt notifications #4
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -140,3 +140,27 @@ def get_trailhead_df(): | |||||
mmb_response = requests.post(mmb_url, json=payload) | ||||||
print('middleman status code', mmb_response.status_code) | ||||||
print(mmb_response.text) | ||||||
|
||||||
## Notifications using IFTTT | ||||||
|
||||||
# Set enable_ifttt to True to receive IFTTT notification | ||||||
enable_ifttt = True | ||||||
event_name = 'hackjohn' | ||||||
ifttt_key = 'cJLFuy0CHPBwK0wqndI2g9' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @neuhoffm, do you not think this is a worthwhile change? Is |
||||||
|
||||||
# Create you own IFTTT (https://ifttt.com/create) | ||||||
# Select webhooks for this and select receive a web trigger | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
for referencem, here are some URLs that the process took me to: https://ifttt.com/create/connect-maker_webhooks?sid=3 |
||||||
# Set event name to match event_name variable above | ||||||
# Create a that to respond to the event (IFTTT rich notifications allow click to call options to the reservation line.) You can add 3 values (specified below). | ||||||
neuhoffm marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
# Go to https://ifttt.com/maker_webhooks and click on documentation, copy & paste your key into the ifttt_key variable above | ||||||
|
||||||
ifttt_hostname = 'https://maker.ifttt.com' | ||||||
ifttt_url = ifttt_hostname + '/trigger/' + event_name + '/with/key/' + ifttt_key | ||||||
|
||||||
if enable_ifttt and not space_df.empty and output_has_changed and min_report_date <= report_date: | ||||||
report = {} | ||||||
report["value1"] = text | ||||||
report["value2"] = '209-372-0740' | ||||||
response = requests.post(ifttt_url, data=report) | ||||||
print('ifttt status code', response.status_code) | ||||||
print(response.text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's default to false since users will have to populate the ifttt fields first