From f10c7a90c0c906054ac71ccb4193e58e0e59c58c Mon Sep 17 00:00:00 2001 From: Mloc-Argent Date: Tue, 6 Aug 2013 15:55:36 +0100 Subject: [PATCH] Another tiny change to IRC nudge. HTML entities are now unescaped so that they show up correctly on IRC. Signed-off-by: Mloc-Argent --- scripts/ircbot_message.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/ircbot_message.py b/scripts/ircbot_message.py index 95673c62f44..4339019e03d 100644 --- a/scripts/ircbot_message.py +++ b/scripts/ircbot_message.py @@ -1,15 +1,19 @@ #!/usr/bin/env python2 -# Two arguments, channel and message. -# EG: "ircbot_message.py #adminchannel ADMINHELP, people are killing me!" +# Four arguments, password host channel and message. +# EG: "ircbot_message.py hunter2 example.com #adminchannel ADMINHELP, people are killing me!" -import sys,cPickle,socket +import sys,cPickle,socket,HTMLParser def pack(): + ht = HTMLParser.HTMLParser() + passwd = sys.argv[1] ip = sys.argv[3] try: - data = sys.argv[4:] #The rest of the arguments is data + data = [] + for in_data in sys.argv[4:]: #The rest of the arguments is data + data += {ht.unescape(in_data)} except: data = "NO DATA SPECIFIED" dictionary = {"ip":ip,"data":[passwd] + data}