Skip to content

Instantly share code, notes, and snippets.

@tjb0607
Created December 6, 2014 08:40
Show Gist options
  • Save tjb0607/0c4094786976d4af6f7a to your computer and use it in GitHub Desktop.
Save tjb0607/0c4094786976d4af6f7a to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import subprocess
import urllib.request
import time
import re
while True:
print('checking')
response = urllib.request.urlopen('http://honestjons.com/shop/latest_100_arrivals')
plaintext = response.read().decode('utf-8')
if re.search('Loefah', plaintext, flags=re.I):
print('found Loefah release on Honest Jon\'s!!!')
break
print('waiting 10 seconds')
time.sleep(10)
subprocess.call(["xdg-open", "http://honestjons.com/shop/latest_100_arrivals"])
subprocess.call(["amixer", "sset", "'Master'", "50%"])
subprocess.call(["ffplay", "-nodisp", "-autoexit", "<<INSERT FILEPATH OF NOTIFICATION SOUND HERE>>"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment