Skip to content

Instantly share code, notes, and snippets.

@ritwikSOP
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritwikSOP/5d1be5e2a09f0c65fa6b to your computer and use it in GitHub Desktop.
Save ritwikSOP/5d1be5e2a09f0c65fa6b to your computer and use it in GitHub Desktop.
Test Gmail's Image Proxy
#!/usr/bin/env python
import requests
counts = {200: 0, 404: 0, 500: 0}
for i in range(0,100):
r = requests.get("<Insert Google's proxy url for your image here>")
if r.status_code in counts:
counts[r.status_code] += 1
print "%s Success rate: %s" % (counts, (counts[200]/float(sum(counts.values()))))
@ritwikSOP
Copy link
Author

Tested on one of the broken images, and I get:
{200: 77, 500: 5, 404: 17} Success rate: 0.777777777778
at the end.

@ritwikSOP
Copy link
Author

Same url today morning: 0.95

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