有没有办法自动化周期性任务:比如使用 python irclib或基于扭曲的 youmomdotcom python irc bot向其他用户或频道发送消息等。
基于irclib的 irc 客户端示例:
from irc import client
class OurIRCClient(client.SimpleIRCClient):
def __init__(self):
client.SimpleIRCClient.__init__(self)
import sys
client = OurIRCClient()
try:
client.connect("irc.freenode.net", 6667, myUserId)
print "connected to irc.freenode.net"
except:
sys.exit(-1)
"error: coouldn't connect to irc server"
client.connection.join("#django-hotclub")
client.start()