Skip to content

Instantly share code, notes, and snippets.

@polamjag
Last active December 25, 2015 02:28
Show Gist options
  • Save polamjag/6902342 to your computer and use it in GitHub Desktop.
Save polamjag/6902342 to your computer and use it in GitHub Desktop.
宿舎ネットとの戦い
#!/usr/bin/python
import urllib.request
import urllib.parse
import sys
#webcon = http.client.HTTPConnetion("www.google.co.jp")
#accc_sv = "www.cc.tsukuba.ac.jp"
# 一の矢
accc_auth = "https://webauth04.cc.tsukuba.ac.jp:8443/cgi-bin/adeflogin.cgi"
values = {"name": "", "pass": ""}
requ = urllib.request.Request(accc_auth, urllib.parse.urlencode(values).encode())
resp = urllib.request.urlopen(requ)
status = resp.getcode()
if status == 200:
print("Authentication Successed")
else:
print("Authenticaion failed with status " + status)
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment