Created
February 3, 2014 10:24
-
-
Save eyenx/8781537 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import urllib.request as ur | |
| import http.server as hs | |
| import socketserver as ss | |
| import os | |
| indexfile="https://paste.eyenx.ch/index.php/W2AGE" | |
| tmpdir="/tmp/schwaul/" | |
| tmpfile="index.html" | |
| try: | |
| os.mkdir(tmpdir) | |
| except OSError: | |
| pass | |
| r=ur.urlopen(indexfile) | |
| o=r.read().decode('utf-8') | |
| f=open(tmpdir+tmpfile,'w') | |
| f.write(o) | |
| f.close() | |
| os.chdir(tmpdir) | |
| handle=hs.SimpleHTTPRequestHandler | |
| httpd = ss.TCPServer(("",8000),handle) | |
| httpd.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment