On Sat, Jul 18, 2009 at 08:49:48AM +1200, Jim Tittsler wrote:
On 17/07/09 16:18, Dan Collins wrote:
On Thu, Jul 16, 2009 at 11:20 PM, Jim Tittslerj...@onnz.net:
I have a bot (using mwclient 0.6.2) that nightly updates some status pages on WikiEducator.org. It has suddenly started failing with an 'Edit conflict' but I can edit the page by hand and the script continues to write to another page. Are there things that would prohibit the API from writing to a page but still allow editing through the wiki?
Yes. Specifically, an edit conflict will cause one attempt to fail and the next to succeed with no problem. For details see http://en.wikipedia.org/wiki/Help:Edit_conflict but essentially someone else changed the page while you were editing it and the wiki wants you to make sure you don't accidentally overwrite their changes.
I think there is something else going on. Writing to this particular page now *always* fails through the API. It always succeeds when I edit through the web. The history of the page says only the bot and my test edits have been performed on the page. The bot continues to write to other pages. Are there other conditions that get reported as edit conflicts?
Are you correctly supplying both the basetimestamp and starttimestamp parameters to the action=edit call?
I found this through: http://www.mail-archive.com/mediawiki-api@lists.wikimedia.org/msg01220.html
I maintain cl-mediawiki (a common lisp pass through to the MediaWiki api) and had this exact problem. The solution for me was to request the revision timestamp rather than relying on the touched value returned from asking for the action tokens.
Using the following query I get the correct timestamp (as well as the touched which is incorrect): action=query&prop=info|revisions&intoken=edit&titles=MyPage&rvprop=timestamp
My question is: What would cause the touched date to be different from the last revision timestamp?
HTH and Thanks for the info, Russ
2009/9/21 Russ Tyndall russ@acceleration.net:
My question is: What would cause the touched date to be different from the last revision timestamp?
You were right on the money: the last rev timestamp is the right value to use, not the touched timestamp, because that's what basetimestamp is checked against. The latter is also updated when the page is purged.
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org