Created
February 6, 2018 09:15
-
-
Save ebergam/668c5e150fe8427adc28a432a7401339 to your computer and use it in GitHub Desktop.
Connect a Python script to IFTTT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
url = ‘http://www.enricobergamini.it/trialpage.html' | |
#load and scrape | |
response = requests.get(url) | |
html = response.content | |
soup = BeautifulSoup(html, “lxml”) | |
number = soup.find(‘h1’, id=’number’).text | |
#notify | |
def notification(message): | |
report = {} | |
report[“value1”] = message | |
requests.post(“https://maker.ifttt.com/trigger/NAME_OF_CHANNEL/with/key/ID_OF_THE_KEY", data=report) | |
notification(number) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment