靠北交大 2.0

新版靠北交大 2.0 讓全校師生都有了審核的權限,每天穩定發出投稿文章。
#靠交5571
import os, time
import getpass
import requests
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
firefox_path = 'C:\\Program Files\\Mozilla Firefox\\firefox.exe'

def login(u,p):
FF = FirefoxBinary(firefox_path)
driver = webdriver.Firefox(firefox_binary=FF, service_log_path=os.devnull)
driver.get("https://140.113.0.38/login.php")
username = driver.find_element_by_name("username")
username.send_keys(u)
password = driver.find_element_by_name("userpwd")
password.send_keys(p)
login = driver.find_element_by_name("btlogin")
login.click()
driver.close()

def main():
print('start time:', time.ctime())
u = str(input('username: '))
p = str(getpass.getpass('password: '))
loop = int(input('loop sleep time(sec): '))
while loop:
try:
response = requests.get('https://www.nctu.edu.tw')
print(response, time.ctime())
except:
login(u,p)
print('去你的垃圾學店網路又斷線', time.ctime())
time.sleep(loop)

if __name__=='__main__':
main()
Telegram: @xNCTU/5595
Plurk: @xNCTU/o2humo
Twitter: @x_NCTU/1321962532806950912
審核結果: 4 票 / 1 票
投稿時間:
靠北交大 2.0
# 系級 暱稱 理由
此區域僅限交大使用者查看

您可以打開 #投稿DEMO ,免登入即可預覽投票介面