Thread:Extension talk:TweetANew/Trouble-shooting this (excellent) extension + some usage hints

Dear fellow Mediawikiarians,

in case you are feeling like I did when things were not working as expected, then don't despair! Even I got it working and so will hopefully you. It took me more than an hour to figure out how things have to be set up. The inter-play with Twitter adds an additional layer of complexity which was completely new to me.

So you have set up and configured this extension
 * on Mediawiki 1.17+
 * with PHP cURL installed ( on Ubuntu 12.04).

Everything is working fine? Congratulations! I wish I had your kind of luck once in a while. :) Though, probably you are not even reading this discussion page anyways if your procedures are similar to mine. Otherwise I suggest the following check-list:


 * Adapt the code of the extension to the new Twitter API v1.1 as suggested below by Lbthomsen (and chime in to my thanks to him).
 * Remove any configurations except the Twitter access codes and set  to zero. Go with the defaults otherwise for the testing phase.

You should then receive a first tweet upon creation of a new page. If not:
 * Check that the access level is indeed set to 'read and write' (as explained below).
 * Make sure you created the page in the main article namespace. For it says in the code: Excludes files or content outside of article namespaces.
 * However, I found that this is not fully true. Tweets are sent for newly created pages also in different (non-standard) namespace. However pages in non-main namespaces are ignored for edits no matter what settings I chose.
 * If you get no tweets at all then the cause most likely lies outside the scope of this extension. Post back here if you find any additional points to check.

Working well it seems? If you go ahead and change the settings to your liking (or -- as I did -- if you had chosen your settings ahead and are looking for help on this discussion page like I did but could not find any) then you may have trouble with getting tweets for edits. You seemingly cannot get a consistent behavior from this extension; sometimes it works but most of the times not. Well the cause of evil here is Twitter, adding some rules to the game that novice Tweeties like myself may not be aware of.

One cannot post the same tweet twice (in a row). So if you chose static settings and turned the random parts off then you will not get any tweet if you edit a page twice. There must be some varying part included into your post which in my case is the edit summary. (Thus I have to train my users (and myself) even harder to write edit summaries. Hopefully they will recognize a successful tweet about their work as an additional reward to that chore.)

Knowing that, you can do some more testing and then decide on your settings. Here are mine (leaving out the Twitter API stuff:

Some notes:
 * Since the extension defines the default values, one must have it included before one's own settings.
 * 'Skipminor' does not override the settings from the check-box ($wgTweetANewEditpage).
 * Setting 'LessMinutesOld' to non-zero makes posts get lost that should be tweeted during the black-out phase after a prior tweet.
 * 'MinorSpace' set to true adds  literally into the tweet. I corrected that in the template page MediaWiki:Tweetanew-minoredit where I added that HTML-code after the text. Since this is parsed by Mediawiki, the space does get included correctly.