logo

scripts

Unnamed repository; edit this file 'description' to name the repository.
commit: 45f73dd6d4379544c3e5c0ce7721c38e3f24ea9e
parent: cb6afab0093256b9d2cc4959073af1cd6e904c3c
Author: lanodan <lanodan.delta@free.fr>
Date:   Mon,  9 Jun 2014 01:19:53 +0200

Add PART Hack and update screenshot

Diffstat:

IRCBot/IRCBot.py | 14+++++++++-----
screenshot | 3++-
2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/IRCBot/IRCBot.py b/IRCBot/IRCBot.py @@ -15,7 +15,7 @@ def get_element(textInput, elem): # Output string into the channel def printIrc(ircout): irc.send('PRIVMSG '+channel+' :'+ircout+'\n') - print '[OUT]'+ircout + print 'PRIVMSG '+channel+' :'+ircout #line: string of text to add in the log def log(line): @@ -52,7 +52,7 @@ printIrc(welcomeMsg) while 1: #puts it in a loop text=irc.recv(2048) #receive the text - print '[IN]'+text + print text if text.find('PING') != -1: #check if 'PING' is found irc.send('PONG ' + text.split() [1] + '\n') #returnes 'PONG' back t @@ -77,6 +77,7 @@ while 1: #puts it in a loop get = urllib.urlopen(url) wget = get.read() mimeType = get.info().type + print get.info() get.close() if (re.search('text/x?html', mimeType)): if wget.find('<title>') != -1: @@ -103,6 +104,8 @@ while 1: #puts it in a loop irc.send('JOIN '+ channel +'\n') #join the chan time.sleep(1) printIrc(welcomeMsg) + #if text.find('JOIN '+channel) != -1: + # printIrc('Ohayo-nyan, '+str(userRegex.findall((text))+' ! [http://i.imgur.com/vzYFOkp.jpg]') if text.find('tetris') != -1: if tetris != 1: printIrc('Never gonna give you up.') @@ -114,11 +117,12 @@ while 1: #puts it in a loop printIrc('Never gonna say goodbye.') printIrc('Never gonna tell a lie and hurt you.') tetris=1 - #if text.find('JOIN '+channel) != -1: - # printIrc('Ohayo-nyan '+str(userRegex.findall((text))+' ! [http://i.imgur.com/vzYFOkp.jpg]') if text.find(':!stop in the name of sey') != -1: + irc.send('PART : '+quitMsg+'\n') #Hack to prevent Clkent Quit irc.send('QUIT : '+quitMsg+'\n') irc.close() break - + if text == "": + irc.close() + break sys.exit() diff --git a/screenshot b/screenshot @@ -1,3 +1,4 @@ #!/bin/sh -date=`date` +# FORRMAT: YYYY-MM-DD-HH:MM:SS +date=`date +%F-%H:%M:%S` import "/seagate/net/the-delta/datalove/img/screens/$date.png" && x-www-browser "http://the-delta.net/datalove/img/screens/$date.png"