Skip to content

Instantly share code, notes, and snippets.

@hasantayyar
Created October 20, 2011 05:41
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 hasantayyar/1300503 to your computer and use it in GitHub Desktop.
Save hasantayyar/1300503 to your computer and use it in GitHub Desktop.
import urllib
def fetch_thing(url, params, method):
params = urllib.urlencode(params)
if method=='POST':
f = urllib.urlopen(url, params)
else:
f = urllib.urlopen(url+'?'+params)
return (f.read(), f.code)
for x in range(0,30):
content, response_code = fetch_thing(
'http://hasantayyar.kimdir.com/sorgu/sosyal_ag_sayac.php',⋅
{'kim': '328', 'ag': 'twitter'},⋅
'POST'
)
print response_code
print x
print '\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment