#!/usr/bin/python
#coding=utf8
from telnetlib import Telnet
user = "uuu"
passwd = "ppp"
board = "bbb"
host = "bbs.newsmth.net"
postids = [xxxxx1, xxxxx2, xxxxxx3, ....]
ENT="\n"
t = Telnet(host, timeout=5)
t.read_until("!§$%&/()", 1)
t.write(user+ENT)
t.read_until("!§$%&/()", 1)
t.write(passwd+ENT)
t.read_until("!§$%&/()", 1)
t.write(ENT)
t.read_until("!§$%&/()", 1)
t.write(ENT)
t.read_until("!§$%&/()", 1)
t.write(ENT)
t.read_until("!§$%&/()", 1)
t.write(ENT)
t.read_until("!§$%&/()", 1)
t.write(ENT)
t.read_until("!§$%&/()", 1)
t.write("s"+board+ENT)
for id in reversed(sorted(postids)):
t.read_until("!§$%&/()", 1)
t.write(str(id)+ENT)
t.write("dy"+ENT)
t.close()
--
修改:moudy FROM 213.95.148.*
FROM 213.95.148.*