There is StartTimestamp property used in edit api, which should contain the time, when you started editing the page. This timestamp needs to be in same timezone as wiki is.
How do you get current wiki time, so that you can either calculate the timezone or use the time? For example:
1) Get current wiki time and store it 2) Edit the page 3) Use previously retrieved ts as StartTimestamp
How can I query the mediawiki in order to get the current time from server's point of view
On Feb 26, 2014 9:14 AM, "Petr Bena" benapetr@gmail.com wrote:
How do you get current wiki time, so that you can either calculate the timezone or use the time?
How about using basetimestamp instead?
https://en.wikipedia.org/w/api.php says:
basetimestamp - Timestamp of the base revision (obtained through
prop=revisions&rvprop=timestamp). Used to detect edit conflicts; leave unset to ignore conflicts
starttimestamp - Timestamp when you obtained the edit token. Used to
detect edit conflicts; leave unset to ignore conflicts
-Jeremy
I am already doing that but I need to resolve conflict in new page.
There is no talk page for a user. I am sending a warning to this user. If some other user with faster internet write that talk page faster than me, I will overwrite it effectively deleting his message (because there is no base revision for non-existent page).
In fact it's even worse. I am using new section for the warning and in this scenario, result is that we both send the warning of same level in same moment for 2 different edits. Which produces https://bugzilla.wikimedia.org/show_bug.cgi?id=61933
On Wed, Feb 26, 2014 at 3:48 PM, Jeremy Baron jeremy@tuxmachine.com wrote:
On Feb 26, 2014 9:14 AM, "Petr Bena" benapetr@gmail.com wrote:
How do you get current wiki time, so that you can either calculate the timezone or use the time?
How about using basetimestamp instead?
https://en.wikipedia.org/w/api.php says:
basetimestamp - Timestamp of the base revision (obtained through
prop=revisions&rvprop=timestamp). Used to detect edit conflicts; leave unset to ignore conflicts
starttimestamp - Timestamp when you obtained the edit token. Used to
detect edit conflicts; leave unset to ignore conflicts
-Jeremy _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
There is also param 'createonly' - Don't edit the page if it exists already -Niklas
HA
That is very useful and it kind of makes the start useless. Combination of base and createonly seems to fit all scenarios to me
On Wed, Feb 26, 2014 at 4:06 PM, Niklas Laxström niklas.laxstrom@gmail.com wrote:
There is also param 'createonly' - Don't edit the page if it exists already -Niklas
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Wed, Feb 26, 2014 at 10:40 AM, Petr Bena benapetr@gmail.com wrote:
HA
That [createonly param] is very useful and it kind of makes the start useless. Combination of base and createonly seems to fit all scenarios to me
starttimestamp should also handle the case where the page was created and deleted in between when you originally checked and when you actually submit the edit. Best would be to correctly use all three.
The starttimestamp is returned when you query prop=info&intoken=edit.
Note the returned timestamp should always be in UTC, formatted in ISO 8601 format (e.g. "2014-02-26T15:01:37Z").
On Wed, Feb 26, 2014 at 9:51 AM, Petr Bena benapetr@gmail.com wrote:
I am already doing that but I need to resolve conflict in new page.
There is no talk page for a user. I am sending a warning to this user. If some other user with faster internet write that talk page faster than me, I will overwrite it effectively deleting his message (because there is no base revision for non-existent page).
In fact it's even worse. I am using new section for the warning and in this scenario, result is that we both send the warning of same level in same moment for 2 different edits. Which produces https://bugzilla.wikimedia.org/show_bug.cgi?id=61933
On Wed, Feb 26, 2014 at 3:48 PM, Jeremy Baron jeremy@tuxmachine.com wrote:
On Feb 26, 2014 9:14 AM, "Petr Bena" benapetr@gmail.com wrote:
How do you get current wiki time, so that you can either calculate the timezone or use the time?
How about using basetimestamp instead?
https://en.wikipedia.org/w/api.php says:
basetimestamp - Timestamp of the base revision (obtained through
prop=revisions&rvprop=timestamp). Used to detect edit conflicts; leave unset to ignore conflicts
starttimestamp - Timestamp when you obtained the edit token. Used to
detect edit conflicts; leave unset to ignore conflicts
-Jeremy _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org