wikifirc

filter irc.wikimedia.org on specific pages and users
git clone https://a3nm.net/git/wikifirc/
Log | Files | Refs | README

commit 440a507d2bbcf876f137fabedbfb85abb242efcc
parent 1dd2969fcd51f2b654d7c1fead37703317bb8241
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Tue, 15 Nov 2016 12:14:45 +0100

do not use shortening API by default

Diffstat:
wikifirc | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/wikifirc b/wikifirc @@ -7,12 +7,15 @@ import time import urllib.parse import urllib.request -API="http://minu.me/api.php?url=%s" +# use an API here if needed +API=None def shorten(url): - return (urllib.request.urlopen(API % - urllib.parse.quote(url)).read() - ).decode('utf-8') + if not API: + return url + return (urllib.request.urlopen(API % + urllib.parse.quote(url)).read() + ).decode('utf-8') # user and user talk namespaces for the various languages of interest # add your language here if it isn't there @@ -61,6 +64,8 @@ class Change: fields.pop(0) # rest of flags2 self.diffc = fields.pop(0)[1:-1] self.message = ' '.join(fields)[3:-1] + print("DEBUG") + print(self.message) def __str__(self): """format the change to an irc line"""