logo

scripts

Unnamed repository; edit this file 'description' to name the repository.
commit: 9d5ffa5591f02bfd79d59c602d8cbf562fb53b41
parent: ea6cc4a633a4983e4cdf2882d33b359150580d22
Author: lanodan <lanodan.delta@free.fr>
Date:   Sat, 12 Jul 2014 22:09:17 +0200

Update regex (rfc 1738)

Diffstat:

IRCBot/IRCBot.py | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/IRCBot/IRCBot.py b/IRCBot/IRCBot.py @@ -74,9 +74,10 @@ while 1: out = t[1].strip() printIrc('\x01ACTION '+out+'\x01') # equivalent of /me if httpRegex.search(text) is not None: # Use httpRegex on input - parse = re.findall('https?://[^\"\'\(\)\[\]\{\}\<\>\ ]+', text) # get only the link in parse + parse = re.findall('https?://[^\{\}\|\\\^\~\[\]\"\'\`\(\)\<\>\ ]+', text) # get only the link in parse try: url = str(parse[0]).rstrip() # Take the parsed link + print 'debug: '+url if (len(url) > 8) : # I assume a link is more than 8 characters long try: get = urllib.urlopen(url) # Open the link @@ -122,7 +123,7 @@ while 1: tetris=1 # Prevent another rick roll if text.find(':!stop in the name of sey') != -1: irc.send('QUIT : '+quitMsg+'\n') - break # break the l∞p + break # break the loop if text == "": irc.send('QUIT : Empty socket input\n') break # break the loop