wikifirc

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

README (3380B)


      1 wikifirc -- filter irc.wikimedia.org on specific pages and users
      2 Copyright (C) 2012 by Antoine Amarilli
      3 
      4 == 0. License (MIT license) ==
      5 
      6 Permission is hereby granted, free of charge, to any person obtaining a
      7 copy of this software and associated documentation files (the
      8 "Software"), to deal in the Software without restriction, including
      9 without limitation the rights to use, copy, modify, merge, publish,
     10 distribute, sublicense, and/or sell copies of the Software, and to
     11 permit persons to whom the Software is furnished to do so, subject to
     12 the following conditions:
     13 
     14 The above copyright notice and this permission notice shall be included
     15 in all copies or substantial portions of the Software.
     16 
     17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     18 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     20 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
     21 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
     22 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
     23 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     24 
     25 == 1. Description ==
     26 
     27 wikifirc is a tool to filter changes from irc.wikimedia.org on specific pages
     28 and users. All events on followed pages, all events by followed users, and all
     29 events on followed users' user and user talk pages are kept and the rest is
     30 discarded; besides, when a followed user edits a page, the page becomes
     31 followed.
     32 
     33 == 2. How to use ==
     34 
     35 Run as wikifirc ADMIN [DUMP]. DUMP is a file that will be read at startup to
     36 initially populate the list of followed users and pages, and written afterwards
     37 to update it. ADMIN should be the nick of the program administrator or
     38 irc.wikimedia.org. Events from irc.wikimedia.org should be provided in the irctk
     39 format on standard input, the data of matching lines will be sent on standard
     40 output (to be piped in irctk) and newly followed pages on standard error.
     41 
     42 The administrator can send the following messages to the program via an IRC
     43 query:
     44 
     45 - exit: Exit the program.
     46 - page PAGE: Follow page PAGE.
     47 - user USER: Follow user USER.
     48 
     49 Note that the program does not acknowledge commands. The administrator is only
     50 authentified by their nick, so keep potential security risks in mind.
     51 
     52 Here is an example of how you can use the program, using irctk
     53 <http://a3nm.net/git/irctk/> and the provided ircfilter.py:
     54 
     55   irctk -q uniquebotnick@irc.wikimedia.org \#fr.wikipedia \#en.wikipedia |
     56     ./ircfilter.py |
     57     ./wikifirc adminnick pagelist |
     58     ./irctk -q botnick@yourserver \#yourchannel
     59 
     60 This call reads recent changes on the English and French Wikipedia, pipes it to
     61 ircfilter.py to avoid encoding issues, then pipes it to wikifirc and pipes it to
     62 your own IRC server. The bot can be controlled by /msg'ing uniquebotnick as
     63 adminnick on irc.wikimedia.org.
     64 
     65 If some of your users have no color code support, you can add the following
     66 before the last irctk call:
     67 
     68   sed -u 's/^.*$/[#color] &\n[#nocolor] &/' |
     69     sed -ru "/^\[#nocolor\]/ s/\x03[0-9][0-9]//g"
     70 
     71 This will produce colored output on channel #color and raw output on channel
     72 #nocolor.
     73 
     74 == 3. Hacking ==
     75 
     76 A few things can easily be tweaked in the code:
     77 
     78 - add support for different languages
     79 - disable coloring
     80 - formatting changes differently
     81 - using a custom URL shortener, or no URL shortener
     82