Skip to content

Instantly share code, notes, and snippets.

@faelp22
Last active April 26, 2018 14:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faelp22/215c02aef7baa72798345722428699e2 to your computer and use it in GitHub Desktop.
Save faelp22/215c02aef7baa72798345722428699e2 to your computer and use it in GitHub Desktop.
import time
import subprocess as s
import requests
URL = 'https://www.ubuntu.com/download/desktop'
def new_version(response):
if '18.04' in response.text:
msg = 'Novo Ubuntu LTS está disponível para download! :) ' + URL
s.call(['notify-send','Pare tudo AGORAAAA!',msg, '-u', 'critical', '-i', 'face-laugh'])
return True
print('Nada ainda :(')
return False
def main():
while not new_version(requests.get(URL)):
time.sleep(60) # 1 minuto
if __name__ == '__main__':
main()
@alessandrosales
Copy link

This code is very cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment