• # mediawiki + tweak

    Posté par (site web personnel, Mastodon) . En réponse au message travail collaboratif autour de plusieurs documents avec alerte sur modification. Évalué à 0.

    Mediawiki peut faire ça, suffit de rajouter soit un plugin, soit simplement faire tourner une crontab et un petit script pour envoyer des mails avec la requete SQL qui va bien : http://www.sputnick-area.net/scripts/mediawiki-alert-by-mail.bash

    #!/usr/bin/env bash
    #
    # ------------------------------------------------------------------------------
    # made by sputnick in da FreAkY lAb (c) 2010-2012
    # gilles.quenot <AT> gmail <DOT> com
    #
    # This program is free software; you can redistribute it and/or
    # modify it under the terms of version 2 of the GNU General Public
    # License published by the Free Software Foundation.
    # (see http://www.gnu.org/licenses/gpl.html).
    # ------------------------------------------------------------------------------
    # ,,_
    # o" )@
    # ''''
    #------------------------------------------------------------------------------#
    #
    # vim:ts=4:sw=4
    sqliteBDD=/home/www/data/wikidb.sqlite
    baseURL=http://wiki.tofes.org/index.php
    . /etc/profile
    export LANG="fr_FR.UTF-8@euro"
    sqlitelink(){ sqlite3 $sqliteBDD "$@"; }
    witness=~/.mediawiki-alert-by-mail-witness
    value=$(< $witness)
    mails=$(sqlitelink "SELECT el_index FROM externallinks WHERE el_index LIKE 'mailto%'" | sed -r 's!mailto:([^\.]+)\.([^@]+)@(.*)\.$!3円@2円.1円!')
    [[ -s $witness ]] || echo 0 > $witness
    IFS='|' read id user_text title comment minor < <(sqlitelink <<-EOF| iconv -f 'utf8' -t 'iso8859-15' 
     SELECT rc_id, rc_user_text, rc_title, rc_comment, rc_minor
     FROM recentchanges
     WHERE rc_id = (
     SELECT rc_id
     FROM recentchanges
     ORDER BY rc_id
     DESC LIMIT 1
     );
    EOF
    )
    if ((minor == 0)); then
     if ((value < $id)); then
    mail -s "[wiki FOOBAR] Modification apportées par $user_text sur la page $baseURL/$title" -- $(sed 's: :,:g' <<< ${mails}) <<-EOF
     Bonjour,
     voici le contenu des modifications de /$title :
     -----8<--------------------------------------------------------------------------------
     ${comment:-<nil>}
     -----8<--------------------------------------------------------------------------------
     Bye, le robot d'alerte du wiki.
     EOF
     fi
    fi
    echo $id > $witness
    
    

    Moi c'est Sqlite, mais facilement adaptable pour MySQL ou autre.

    On ne peut pas mettre d'array dans le string...