[m [34m�� ��Դ:��ˮľ���� http://newsmth.net��[FROM: 60.63.77.*] [m
#!/usr/bin/env python
# -*- coding: gbk -*-
import re
import telnetlib
import time
def loginBBS():
user = "xx"
password = "xxx"
tn = telnetlib.Telnet("bbs.newsmth.net")
# tn.set_debuglevel(1)
tn.read_until("��������:")
time.sleep(1)
tn.write(user + "\n")
tn.read_until("����������:")
time.sleep(1)
tn.write(password + "\n")
for i in range(5):
tn.write("\n")
tn.read_very_eager()
time.sleep(1)
time.sleep(1)
time.sleep(1)
tn.write("eq")
tn.read_until("S) ѡ���Ķ�������")
time.sleep(1)
return tn
def readBoard(tn):
tn.write("s\n")
tn.read_until("��������������� ")
time.sleep(1)
tn.write("ticket\n")
tn.write("$")
tn.read_until("[һ��ģʽ] ")
tn.read_until("\x1b[m")
postlist = tn.read_very_eager()
info = search(postlist)
if info:
msg(tn, info)
# unread = re.search('(\s+\d+ \* .*)', postlist)
# if unread:
# print unread.group()
while re.search(' \* ', postlist):
tn.write("P")
postlist = tn.read_very_eager()
info = search(postlist)
if info:
msg(tn, info)
time.sleep(1)
tn.write("$")
tn.read_very_eager()
time.sleep(1)
tn.write("c")
tn.read_very_eager()
time.sleep(1)
tn.write("e")
def logout(tn):
tn.read_until("G) �뿪ˮľ")
tn.write("g\n")
tn.read_until("�뿪��BBSվ")
tn.write("\n")
time.sleep(1)
tn.write("\n")
tn.read_all
tn.close()
def loop():
tn = loginBBS()
while 1:
time.sleep(60)
readBoard(tn)
logout(tn)
�� �� python818 (��ʵ��ë��) �Ĵ������ᵽ: ��
: ˼���˺ü���
: ����һ�� ˮľ��վ����
--
For every action, there is an equal and opposite criticism.
Never do card tricks for the group you play poker with.
No one is listening until you make a mistake.
The colder the X-ray table, the more of your body is required on it
The severity of the itch is proportional to the reach.
To steal ideas from one person is plagiarism; to steal from many is research.
[36m�� ��:��xxxss �� May 26 16:24:08 2009 �ı��ġ�[FROM: 211.99.222.*] [m
[m [1;34m�� ��Դ:��ˮľ���� newsmth.net��[FROM: 211.99.222.*] [m
�� �� python818 (��ʵ��ë��) �Ĵ������ᵽ: ��
: ˼���˺ü���
: ����һ�� ˮľ��վ����
--
[1;31m�c��
[1;32m�c�ʥ� �ȥ� �f�u�c �c�� �Τ� �c/ ����
[1;33m �� ���� �� �� ���' �̩��� /�� �թ��f
[1;34m �� ���� �` ��
[m [1;31m�� ��Դ:��ˮľ���� newsmth.net��[FROM: 221.221.145.*] [m
--
���������� ����� ���������� ��ϴ����ԩ
[m [1;34m�� ��Դ:��ˮľ���� newsmth.net��[FROM: 219.239.50.*] [m
--
[1;30m锟斤拷奴->锟斤拷锟斤拷奴->锟斤拷锟斤拷奴->X61奴->锟斤拷奴->52锟斤拷全锟斤拷锟斤拷奴->锟斤拷锟斤拷M8奴-> [1;34m锟斤拷奴
[m [1;35m锟斤拷 锟斤拷源:锟斤拷水木锟斤拷锟斤拷 newsmth.net锟斤拷[FROM: 219.143.133.*] [m
--
[m [1;33m�� ��Դ:��ˮľ���� newsmth.net��[FROM: 211.99.222.*] [m
--
[m [1;37m�� ��Դ:��ˮľ���� newsmth.net��[FROM: 218.107.55.*] [m