Created
November 19, 2018 00:50
-
-
Save nrm176/cc26b9212ef785e012eab568305cd877 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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