Extension:Send2StatusNet

What can this extension do?
This extension lets users push updates to any StatusNet / GNU social site of their choice whenever they make an edit or create a new page on the wiki. The messages are customizable and urls are shortened with either is.gd or ur1.ca (currently down).

Users input their username and password in the "Misc" section of "My preferences" (see picture below) and set some configuration parameters.

Usage
In the "Misc" tab of "My preferences", a user may input the username and password of their StatusNet (SN) / GNU social (GS) account and choose whether to send updates about new articles and/or edits to existing articles, plus selecting the service to shorten the URLs with.

Other configuration parameters are:
 * Karma - only notify when you are lucky today
 * depending on the dice there will be no dent with the page name, but a general link to the wiki instead + the tags #wiki and #karma will be added
 * remove text from article titles
 * (e.g. in my Mediawiki blog all my page names start with: Blog:Observations/ + since dents have a limit on text, this is useful)

API to use
use for the API: http://YOURSERVER/api/statuses/update.xml

please consider: send each edit or only wiki articles ?
If you select "Notify StatusNet site below every time you edit" you should be aware that in some cases this can "backfire" (e.g. spam, new users trying out something) + who knows you may get banned somewhere because of this :-( I'd recommend to use first "Notify StatusNet when you start a new article".

how to enable other micro-blogging services
Some of those SN/GS instances also offer a twitterbridge, so you can cross-post to twitter. The API of SN/GS is very similar to that of friendica, so that should be addable with few efforts

changes to old version
This extension has following changes to Extension:SendToIdentica:
 * one can post now to any StatusNet site, not only identi.ca
 * post only when the extension is activated, can be useful in cases of spam or test edits by new users
 * remove text from article names (e.g. in my Mediawiki blog all my page names start with: Blog:Observations/ + since dents have a limit on text, this is useful)
 * configuration of the extension is easier (it's now in your wiki preferences) + also can be done without shell access
 * karma factor
 * why did I implement this? software should also be fun :-)
 * make URL shorteners also customizable in options (2 services offered)

tested versions so far
tested with current (2011-10-14) versions of: The extension is set up in this wiki if you want to see it in action.
 * MediaWiki 1.17.0
 * StatusNet 1.0.1

change log
2011-10-14: version 1.3.2
 * see here: add a 2nd URL shortener since the existing one does not work anymore
 * start with refactoring code

Download instructions
Please cut and paste the code found below and place it in:  and , respectively. (Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.)

Installation
To install this extension, add the following to LocalSettings.php:

Send2StatusNet uses the GetPreferences hook and so requires MediaWiki 1.16 or later.

Note: This extension needs php-curl to work.