Posted By

surfeurX on 12/21/09


Tagged


Versions (?)

get country with appengine


 / Published in: Python
 

  1. def get_country(ip):
  2. """ return the coutry of an ip adress """
  3. result = urlfetch.fetch(url="http://api.wipmania.com/%s" % ip)
  4. if result.status_code == 200:
  5. return result.content
  6. else:
  7. get_country(ip)

Report this snippet  

You need to login to post a comment.