Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nrm176/cc26b9212ef785e012eab568305cd877 to your computer and use it in GitHub Desktop.
Save nrm176/cc26b9212ef785e012eab568305cd877 to your computer and use it in GitHub Desktop.
import requests
import time
import os
def download():
URL = 'http://www.boj.or.jp/announcements/release_2018/k180731a.pdf'
response = requests.get(URL)
if response.status_code == 200:
with open('./k180731a.pdf', 'wb') as f:
f.write(response.content)
return True
else:
os.system('say not found')
return False
if __name__ == '__main__':
while True:
time.sleep(5)
x = download()
if x:
os.system('say released')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment