logo

scripts

A bunch of scripts, some to be moved to their own repository
commit: eb30387200ab1964fb6b285b14e7c4cf87a9720e
parent: 92b7b3d6489f8f858e3224275402909865ec60cb
Author: lanodan <lanodan.delta@free.fr>
Date:   Sat, 15 Mar 2014 02:51:43 +0100

Improve url parser

Diffstat:

MIRCBot/.IRCBot.py.swp0
MIRCBot/IRCBot.py4++--
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/IRCBot/.IRCBot.py.swp b/IRCBot/.IRCBot.py.swp Binary files differ. diff --git a/IRCBot/IRCBot.py b/IRCBot/IRCBot.py @@ -73,7 +73,7 @@ while 1: #puts it in a loop to = t[1].strip() #this code is for getting the first word after !hi irc.send('PRIVMSG '+channel+' :'+str(to)+'\n') if text.find('http') != -1: - parse = re.findall('https?://[^\"\'\(\)\[\]\{\}\<\>]+', text) + parse = re.findall('https?://[^\"\'\(\)\[\]\{\}\<\>\ ]+', text) url = str(parse[0]).rstrip() #took the first link and remove newline and whitespaces if check_url(url): get = urllib.urlopen(url) @@ -85,6 +85,6 @@ while 1: #puts it in a loop print '('+url+')Title: '+title if text.find(':!source') != -1: irc.send('PRIVMSG '+channel+' :My sourcecode is under CC-BY-SA and available at the following address: https://github.com/lanodan/scripts/tree/master/IRCBot \n') - if text.find(':!stop in the name of the DrPepper') != -1: + if text.find(':!stop in the name of sey') != -1: irc.send('QUIT : '+quitMsg+'\n') sys.exit(0)