pip3 install PTTLibrary
from PTTLibrary import PTT
PTTBot = PTT.Library(ID, Password)
ErrCode = PTTBot.login()
if ErrCode != PTT.ErrorCode.Success:
PTTBot.Log('登入失敗')
sys.exit()
......
PTTBot.logout()
API | 說明 |
---|---|
getVersion | 取得版本資訊 |
login | 登入 |
logout | 登出 |
post | 發佈文章 |
push | 推文 |
寄信 | |
getPost | 取得文章資訊 |
getNewestIndex | 取得該看板最新的文章編號或者信箱最新信件編號 |
giveMoney | 給予使用者 P 幣 |
getTime | 取得 PTT 系統時間 |
getUser | 取得使用者資訊 |
crawlBoard | 多線程爬蟲 以多重登入增加爬蟲速度 可傳入 call back 自訂存檔格式 |
getMail | 取得信件資訊 |
Log | 顯示訊息 |
changePassword | 變更密碼 |
replyPost | 回覆文章 |
throwWaterBall | 丟水球 |
delPost | 刪除文章 |