comparison bin/hurl @ 10316:cfa55b232b54

<fizzie> sled bin/hurl//s,codu.org/projects/hackbot,hackego.esolangs.org,
author HackBot
date Sat, 18 Feb 2017 19:00:28 +0000
parents d0c60ac05f54
children c1a6de70613d
comparison
equal deleted inserted replaced
10315:a145f334de50 10316:cfa55b232b54
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 import sys, os.path, re, urllib 2 import sys, os.path, re, urllib
3 if len(sys.argv) <= 1: 3 if len(sys.argv) <= 1:
4 print "http://codu.org/projects/hackbot/fshg/" 4 print "http://hackego.esolangs.org/fshg/"
5 else: 5 else:
6 f = os.path.abspath(sys.argv[1]) 6 f = os.path.abspath(sys.argv[1])
7 f = re.sub(r"^/+hackenv/", "", f) 7 f = re.sub(r"^/+hackenv/", "", f)
8 if re.match(r"/|(?:\.hg|tmp)(?:/|$)",f): 8 if re.match(r"/|(?:\.hg|tmp)(?:/|$)",f):
9 sys.exit("File is outside web-viewable filesystem repository.") 9 sys.exit("File is outside web-viewable filesystem repository.")
10 else: 10 else:
11 print ("http://codu.org/projects/hackbot/fshg/index.cgi/log/tip/" + 11 print ("http://hackego.esolangs.org/fshg/index.cgi/log/tip/" +
12 urllib.quote(f)) 12 urllib.quote(f))