Skip to content

Instantly share code, notes, and snippets.

@ebergam
Created February 6, 2018 09:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebergam/668c5e150fe8427adc28a432a7401339 to your computer and use it in GitHub Desktop.
Save ebergam/668c5e150fe8427adc28a432a7401339 to your computer and use it in GitHub Desktop.
Connect a Python script to IFTTT
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