All pastes #420197 Raw Edit

Unnamed

public python v1 · immutable
·published 2007-04-01 23:09 UTC
rendered paste body
#!/usr/bin/env python__module_name__ = "ramac"__module_version__ = "1.0"__module_description__ = "silly script substitutes thoreau"import xchatimport urllibfrom random import randrangepath_to_walden = "http://www.gutenberg.org/dirs/etext95/waldn10.txt"walden = urllib.urlopen(path_to_walden)hdt_lines = walden.read().split("  ")def on_message(word, word_eol, userdata):  if xchat.nickcmp(word[0], "ramac") == 0:    buf = ''    while buf == '':      buf = hdt_lines[randrange(0, len(hdt_lines))].strip().replace("\r\n", " ")    xchat.prnt(buf)    return xchat.EAT_XCHAT  returnxchat.hook_print("Channel Message", on_message)print "script loaded. veuillez arreter le rampement."