view bin/url @ 11317:16da968350f1

<zzo38> slashlearn cricket//Cricket is one team is in and one team is out, and the team who are out try to get the team who is in to be out, and then the team who was previously out can be in. Whoever earn more points wins, unless you run out of time, in which case nobody wins.
author HackBot
date Sun, 14 Jan 2018 03:44:32 +0000
parents 31fc0eb7ea45
children 380e297c7ae5
line wrap: on
line source

#!/usr/bin/env python
import sys, os.path, re, urllib
if len(sys.argv) <= 1:
    print "https://hackego.esolangs.org/fshg/"
else:
    f = os.path.abspath(sys.argv[1])
    f = re.sub(r"^/+hackenv/", "", f)
    if re.match(r"/|\.hg(?:/|$)",f):
        sys.exit("File is outside web-viewable filesystem repository.")
    elif re.match(r"tmp(?:/|$)",f):
        print ("https://hackego.esolangs.org/" + urllib.quote(f))
    else:
        print ("https://hackego.esolangs.org/fshg/index.cgi/file/tip/" +
            urllib.quote(f))