Posted By

surfeurX on 12/21/09


Tagged

shorturl


Versions (?)

shorturl with python and appengine


 / Published in: Python
 

  1. def sorten_url(url):
  2. """ return a short url using urlal.com """
  3. result = urlfetch.fetch(url="http://urlal.com/?u=%s&o=j" % url)
  4. if result.status_code == 200:
  5. return eval(result.content)["Message"].replace('\/', '/')
  6. else:
  7. sorten_url(url)

Report this snippet  

You need to login to post a comment.