Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Mugsy DeepDive Bot
# Requires: requests, bs4, python-pushover
import time
import requests
from bs4 import BeautifulSoup
from pushover import init, Client
known_last_updated = ""
USER_KEY = "<pushover_user_key>"
APP_KEY = "<pushover_app_key>"
EMAIL = "<your_email>"
BACKER_NUMBER = "<your_backer_number"
while True:
print("Checking deep dive")
result ="",
data={"email": EMAIL, "backerNumber": BACKER_NUMBER})
soup = BeautifulSoup(result.text, 'html.parser')
status ="body > div > div:nth-child(3) > div > p:nth-child(4) > b")[0].text.rstrip(" ")
expected_delivery ="body > div > div:nth-child(3) > div > p:nth-child(5) > b")[0].text
tracking ="body > div > div:nth-child(3) > div > p:nth-child(6) > b")[0].text
last_updated ="body > div > div:nth-child(3) > div > p:nth-child(7) > b")[0].text
print("Status '%s', delivery on %s, tracking #: '%s' and last updated %s"
% (status, expected_delivery, tracking, last_updated))
if last_updated != known_last_updated:
print("Sending Notification")
Client(USER_KEY).send_message("Status '%s', delivery on %s, tracking #: '%s' and last updated %s"
% (status, expected_delivery, tracking, last_updated), title="Mugsy Update!")
known_last_updated = last_updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment