diff --git a/tinyurl.py b/tinyurl.py index fed7a9d..8133355 100755 --- a/tinyurl.py +++ b/tinyurl.py @@ -103,15 +103,18 @@ def tinyurl(x): if x.startswith("http://tinyurl.com") \ or x.startswith("http://preview.tinyurl.com") \ or x.startswith("http://is.gd") \ + or x.startswith("http://sla.ac/a/") \ or x.startswith("http://geek.cn"): realurl[x] = x return x if not debug: try: + f = fetch_url("http://sla.ac/a/api.php?url=" + urlencode(x)) + r = f.read() #f = fetch_url("http://is.gd/api.php?longurl=" + x.replace("%","%25")) #r = f.read() - f = fetch_url("http://geek.cn/create.php?type=raw&url="+urlencode(x)) - r = f.read() + #f = fetch_url("http://geek.cn/create.php?type=raw&url="+urlencode(x)) + #r = f.read() print "url:",`x`,"tinyurl:",`r` tinycache[x] = r realurl[r] = x