Created
January 23, 2015 10:24
-
-
Save iperdomo/73f1446972a1a26e3781 to your computer and use it in GitHub Desktop.
Small GAE notification script
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
#!/bin/env python | |
import time | |
import requests | |
base = 'https://xxx.appspot.com/processor' | |
with open('some-file.txt', 'r') as f: | |
i = 1 | |
for line in f: | |
zipname = line.split('/').pop().strip('\n') | |
print('Processing: {0}'.format(zipname)) | |
payload = {'action': 'submit', 'fileName': zipname} | |
r = requests.get(base, params=payload) | |
print('Notifying {0}'.format(r.url)) | |
if r.status_code == 200: | |
print('Status: OK') | |
else: | |
print('Status: Error') | |
if i % 50 == 0: | |
time.sleep(60) | |
i = i + 1 | |
print('Total processed: {0}'.format(i-1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment