Page MenuHomePhabricator

Make last modified timestamp on page views machine-readable
Open, LowestPublicFeature

Description

Author: bugspray7

Description:
Per the referenced Village Pump discussion, please add an approximate "time delta since last modification" field near the existing "last modified" timestamp field at the page footer.

Currently says:
This page was last modified on June 17, 2009 at 22:55.

Want something like:
This page was last modified on June 17, 2009 at 22:55 (about 3 hours ago).


Version: unspecified
Severity: enhancement
URL: http://en.wikipedia.org/wiki/Wikipedia:Village_pump_(proposals)/Archive_48#display_time_since_last_edit_on_article
See Also:
T56619: Add a wgCurRevisionTimestamp to mw.config

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:42 PM
bzimport set Reference to bz19276.
bzimport added a subscriber: Unknown Object (MLST).

Changed component from Wikimedia to MediaWiki. This is a software feature request.

herd wrote:

This would be broken into little pieces by cache, and rather useless I think.

Here is an experimental gadget. It is necessarly a big ugly horrible mash of functions to find what timezone offset the time given was actually in (one can NOT assume it is the same as the browser's): http://en.wikipedia.org/wiki/User:Splarka/lastmod.js

What could be done, is to have <li id="lastmod"> contain a comment like:

<li id="lastmod"> This page was last modified on 18 June 2009 at 00:54. <!--1245316447--> </li>

This then could very easily be parsed as a Unix timestamp by javascript, making the above gadget about 1/10th the size, with no API calls. There would also be no cache issues.

Suggest repurpose the bug for exposing unix time (hidden?) into the <li>.

bugspray7 wrote:

Sounds good. The VPP discussion suggested JavaScript would likely need to be employed to avoid breaking caching.

herd wrote:

Okay, it looks like all skins have the "last modified" text. per Skin::lastModified

However, they are not in an object with consistent class or id. It can be <li id="lastmod">, <li id="foot-info-lastmod">, <p>, etc.

Suggest changing the bug to request the function to either:

  1. return $s wrapped in a <span id="lastmodmsg"> (excluding the "wfMsg('laggedslavemode')" <strong> msg) and insert the unix timestamp as a comment: <!--1245316447--> inside the span.
  1. just wrap the comment in a span with unique ID (a bit silly).
  1. just inserting the comment anywhere on the page (probably in the lastmod function, for convenience) but with identifying characteristics, such as a non-translated consistent string: <!--lastmod:1245316447-->.

Any of these would make it easy enough to report a much more accurate time since last edit in javascript, even with cache.

If it's going to be included at all, just stick it in the JS vars...

herd wrote:

If it's going to be included at all, just stick it in the JS vars...

Oh come on, where is the challenge in that ^_^.

wgCurRevisionTimestamp?

Change 562593 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] skins: Use HTML5 <time> for footer lastmod

https://gerrit.wikimedia.org/r/562593

Change 562593 abandoned by Krinkle:
skins: Use HTML5 <time> for footer lastmod

https://gerrit.wikimedia.org/r/562593

Krinkle renamed this task from Add time elapsed next to last modified timestamp, or js variable (wgCurRevisionTimestamp) to Make last modified timestamp on page views machine-readable.May 12 2020, 12:03 AM
Krinkle updated the task description. (Show Details)
Jdlrobson subscribed.

Could someone summarize the value statement of this bug to help us prioritise? Given this was raised in 2009 and the abandoned patchset I'm wondering if we should decline.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:02 AM