Skip to content

Instantly share code, notes, and snippets.

@iperdomo
Created January 23, 2015 10:24
Show Gist options
  • Save iperdomo/73f1446972a1a26e3781 to your computer and use it in GitHub Desktop.
Save iperdomo/73f1446972a1a26e3781 to your computer and use it in GitHub Desktop.
Small GAE notification script
#!/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