Last active
December 25, 2015 02:28
-
-
Save polamjag/6902342 to your computer and use it in GitHub Desktop.
宿舎ネットとの戦い
This file contains 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 | |
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