commit e34e0be45ed386e4d4837cf4e97967f526dbefc1
parent ba89f5fce1aeb13895c2c9c60dbcbdcb7cd8536a
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Tue, 15 Nov 2016 11:40:47 +0100
do not follow special pages
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/wikifirc b/wikifirc
@@ -22,6 +22,10 @@ user_namespaces = [
'Gebruiker:', 'Overleg gebruiker:', # nl
]
+special_namespaces = [
+ 'Special:', 'Spécial:'
+ ]
+
colors = {
'green': 3,
'red': 4,
@@ -140,8 +144,14 @@ if __name__ == "__main__":
line = Change(project, data)
# a user is followed if its user page is followed
if user_namespaces[0] + line.username in pages:
- print("== I started to follow page %s" % line.page)
- register(pages, line.page, fout)
+ # do not follow special pages
+ special = False
+ for special_namespace in special_namespaces:
+ if line.page.startswidth(special):
+ special = True
+ if not special:
+ print("== I started to follow page %s" % line.page)
+ register(pages, line.page, fout)
if line.page in pages:
print(line)