Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions hackjohn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = False
event_name = 'hackjohn'
ifttt_key = 'cJLFuy0CHPBwK0wqndI2g9'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ifttt_key = 'cJLFuy0CHPBwK0wqndI2g9'
ifttt_key = 'replace-with-ifttt-key'

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neuhoffm, do you not think this is a worthwhile change? Is cJL.... a real key or just an example? We will want to do whatever is most clear to let users know that they must replace the value with their key.


# Create you own IFTTT (https://ifttt.com/create)
# Select webhooks for this and select receive a web trigger
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Select webhooks for this and select receive a web trigger
# Select webhooks for this and select "Receive a web request".

for referencem, here are some URLs that the process took me to:

https://ifttt.com/create/connect-maker_webhooks?sid=3
https://ifttt.com/create/if-receive-a-web-request?sid=9
https://ifttt.com/create/if-receive-a-web-request-then-send-a-rich-notification-from-the-ifttt-app?sid=14

# 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).
# 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)