Extension:WikiTweet

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
WikiTweet

Release status: beta

Wikitweet-main.png
Implementation Notify, Ajax
Description Insert a Twitter-like application in your Wiki. Using registered users.
Author(s) Thomas Fauré
Last version v0.9.0 beta (August 29, 2011)
MediaWiki 1.14.x, 1.15.x, 1.16.x, 1.17.x
PHP 5
Database changes yes
License GPL 3.0
Download
Change Log
Tags
<wiki-tweet/>
Check usage and version matrix

Feedback tfa.jpg Please give me your feedback

This extension is able to include a twitter-like feed into MediaWiki which is based on the registered users.

Features [edit]

  • v0.9.0 (29 08 2011)
    • Add the possibility to comment a post (like in facebook)
    • Add 4 status to attribute to a tweet : alert, attention, information or talk
    • Add a page to see all the alerts and attentions (status)
    • A better email management, with lots of stuffs
    • And a lot of things more...
  • v0.5.0 (5 5 2011)
    • Enhance security features (SQL injection and AJAX execution)
    • Simplify configuration file
  • v0.4.0
    • Add an anonymous mode
    • Add a key to configure if you allow the "not connected" tweets or not.
    • If you click on a room link, you can see the tweet from this room.
    • tagging feature (see below)
  • v0.3.2
    • interpretation of "www" links (without http)
    • creation of a "medium" size option (size="medium")
    • auto refresh every 5 seconds
    • send a mail when a user is subscribed to a room or a user.
  • v0.3.0
    • Add an "Tweet and email" button when the status contain "@someone", to send him an email with the content of the tweet
    • Mails sent by "Tweet and email" button are sent from wikiuser email if filled, else by "someone@somewhere.com" (customizable in updatetweet.php)
    • Possibility to send "private" tweets (a "private" button appears when you tape a "@" character)
    • Possibility to allow a list of users to write tweets instead of an "informer" user (a "via Informer" button appears for these users - you have to create this user before if you want to link the tweets with a real profile, but it is optional)
    • only one file where configure everything
    • Add an "administrator" role who can delete every tweets (from any user). More than one user can be administrators)
    • Possibility to delete the private tweets
    • Add a "answer to" option.
  • v0.2.0
    • Rooms management : each tweet is marked by the room where it is posted
    • Subscriptions to (subscribe/unsubscribe in ajax techno) :
      • a room : see the tweets related to the followed room in any other room
      • a user : see the tweets related to the user followed in any room
    • Possibility to delete a tweet
  • v0.1.0
    • Auto refresh (ajax)
    • tweet without reload the page (ajax)
    • Each user is able to tweet when connected
    • If you are not connected, you can view everything but not write a tweet
    • Avatar auto management (replacing by a default one if not defined for the user)

Details [edit]

tagging feature: [edit]

the users could add one or more tags in their tweets just in adding "#" before the words they want to tagg. For example below, the "User2" wrote a tweet with two tags : "tag" and "tagging":

2010-07-12 154154-2.png

If you click on the #tag link, you should have only the tweets with this word (tagged or not), in any rooms:

2010-07-12 154210-2.png

You can see that the first tweet is a tweet from room "test" (and posted with an anonymous account - first feature)..

"Update and email" : [edit]

  • Without "@" character:

WikiTweet-UpdateAndEMail1.png

  • With "@" character, you are able to send an alert by mail ! :-)

WikiTweet-UpdateAndEMail2.png

note [edit]

only for 0.2.3 beta version add the following line in LocalSettings.php above require_once("$IP/extensions/WikiTweet/WikiTweet.php"); :

$wgWikiTweetInformer = array("user1","user2")

If you want the "informer" and "private" possibility, I recommend you to download the next 0.2.4 which is a debug of the 0.2.3.

Download instructions [edit]

Download a snapshot on Special:ExtensionDistributor/WikiTweet

Currently available on 1.16.x and trunk (under dev).

and unarchive it in $IP/extensions/. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

It will create a $IP/extensions/WikiTweet/ directory.

Installation [edit]

To install this extension, first of all, install the ParserFunctions extension. Then, add the following to LocalSettings.php:

require_once("$IP/extensions/WikiTweet/WikiTweet.php");

Creation of WikiTweet DB tables [edit]

Nothing to do : automatically done by the script.

Configuration [edit]

Open extensions/WikiTweet/WikiTweet.config.php and customize it :

<?php
        $wgWikiTweet = array(
                // User roles configuration :
                'informuser'   => "Informer",                  // A special generic user, who informs
                'informers'    => array("Admin","WikiSysop"),  // Who are allowed to post instead of the "Informer"
                'admin'        => array("Admin"),              // Who are the wikitweet administrators
                'allowAnonymous'    => True,                   // Is it possible to tweet anonymously ?
                'AnonymousUser'     => 'Anonymous',            // Who is the "Anonymous user" (fictive user)
                'allowDisconnected' => False,                  // Is it possible to post tweet when not log in ?
                'refreshTime'       => 15000,                  // Time to refresh in milliseconds
                'textlength'        => 500,                    // Tweet text length (140 by default)
                'dateformat'   => 'H:i, F jS',                 // 'H:i, F jS' by default
                'alertroom'    => 'alerts',                    // alert room name
                'showsubscriptions' => 0,                      // Show subscriptions to a room
                'rows' => 100,                                 // How mant rows to display in a timeline
                'roomlink' => 'Discussion:' ,                  // Prefix for the link of a room
                'tweetandemail' => True,                       // Allow forced "email" sending
 
                // SMTP configuration :
                'email'=> true,                                // Allow email sending
                'SMTP'         => array(                       // SMTP configuration
                         'host'    => "localhost",                 //could also be an IP address
                         'IDHost'  => "",
                         'port'    => 25,
                         'auth'    => false,
                         'username'=> "",
                         'password'=> ""
                        ),
                'wikimail'     => 'wikitweet@yourdomain.com',  // generic sender email
                'wikimail-concerns' => 'wikitweet-concerns@yourdomain.com',
                'wikimails'    => array(
                                '0' => 'wikitweet@yourdomain.com',
                                '1' => 'wikitweet@yourdomain.com',
                                '2' => 'wikitweet-attention@yourdomain.com',
                                '3' => 'wikitweet-alert@yourdomain.com'
                        ),
 
                // Size CSS configuration :
                'size'         => array(
                        'normal'   => array(
                                'line_height'       => '16px',         // Height of a tweet line
                                'font_size'         => '14px',
                                'avatar_size'       => '48',           // Size of the avatar picture (in px)
                                'span_avatar_width' => '50px',
                                'paddingli'         => '10px 0 8px',
                                'margin_left'       => '0px',
                                'child_line_height'       => '13px',         // Height of a tweet line
                                'child_font_size'         => '12px',
                                'child_avatar_size'       => '35',           // Size of the avatar picture (in px)
                                'child_span_avatar_width' => '37px',
                                'child_paddingli'         => '5px 0 3px',
                                'child_margin_left'       => '20px',
                                ),
                        'medium'   => array(
                                'line_height'       => '13px',
                                'font_size'         => '14px',
                                'avatar_size'       => '35',
                                'span_avatar_width' => '37px',
                                'paddingli'         => '5px 0 3px',
                                'margin_left'       => '0px',
                                'child_line_height'       => '13px',
                                'child_font_size'         => '11px',
                                'child_avatar_size'       => '35',
                                'child_span_avatar_width' => '37px',
                                'child_paddingli'         => '5px 0 3px',
                                'child_margin_left'       => '15px',
                                ),
                        'small'   => array(
                                'line_height'       => '13px',
                                'font_size'         => '11px',
                                'avatar_size'       => '35',
                                'span_avatar_width' => '37px',
                                'paddingli'         => '5px 0 3px',
                                'margin_left'       => '0px',
                                'child_line_height'       => '12px',
                                'child_font_size'         => '10px',
                                'child_avatar_size'       => '28',
                                'child_span_avatar_width' => '30px',
                                'child_paddingli'         => '5px 0 3px',
                                'child_margin_left'       => '10px',
                                ),
                        ),
                'inherit'      => array(                            // inherit tree description
                        'main' => array('room1','room2','room3'),
                        'room1'     => array('room1.1'),
                        'room3'     => array('room3.1','room3.2')
                        ),
                'titles' => array(                                 // Aliases for the rooms
                        "room1"   => "Title room 1",
                        "room1.1" => "Title room 1.1",
                        "room2"   => "Title room 2",
                        "room3"   => "Title room 3",
                        "room3.1" => "Title room 3.1",
                        "room3.2" => "Title room 3.2"
                )
                );
?>

Usage [edit]

tag insertion syntax [edit]

<wiki-tweet/>

or

<wiki-tweet options/>

Where options can be :

  • size : three modes (size="small", size="medium" and size="normal" - default)
  • rows : indicates the number of tweets displayed (eg. rows="10")
  • room : indicates the name of the room feed (defined by this.. You dont have to register a room somewhere, default="main")

Example [edit]

<wiki-tweet rows="10" size="small" room="test-room"/>

Tweets syntax [edit]

  • "@" before any user name (link created to the user page - customize it !)
  • ">" before any wiki link
  • "#" before any word you want to tag

Avatar [edit]

  • upload your profile avatar in importing a username.png (or .jpg) file into the Wiki.

Screenshots [edit]

Wikitweet-main.png

WikiFeeds.png