In today's world,
User:Davipo/wikipast.js continues to be a topic of great relevance and interest. Throughout history,
User:Davipo/wikipast.js has had a significant impact on different aspects of society, culture and everyday life. In this article, we will explore in detail the importance of
User:Davipo/wikipast.js, as well as its influence in various areas. From its origin to its evolution today,
User:Davipo/wikipast.js has generated endless debates, research and reflections that have contributed to enriching our knowledge on this topic. Through a deep and thoughtful analysis, we will try to shed light on the most relevant aspects of
User:Davipo/wikipast.js and its relevance in the contemporary world.
// wikipast.js
// User:Davipo
// 2009-03-16, revised 2009-09-25
/* WikiPast: Browse Wikipedia as it appeared on a given date in the past.
Works with TimeTraveller.
*/
var pastdate = "1999-01-01";
function seeback() {
var entry = prompt("Enter date:", pastdate);
if (entry != null) {
pastdate = entry;
query_rev(wgArticleId, pastdate);
}
}
function query_rev(pageid, date) {
var qbase = "/w/api.php?action=query";
var query = qbase + "&prop=revisions&rvlimit=1&rvprop=timestamp|ids&rvdir=older&format=json";
query = query + "&pageids=" + pageid + "&rvstart=" + date + "T00:00:00Z";
api.open('GET', wgServer + query, true);
api.onreadystatechange = show_revision;
api.send(null);
}
function show_revision() {
if (api.readyState == 4) {
if (api.status == 200) {
var response = eval('(' + api.responseText + ')');
var pageinfo = response;
if (pageinfo) {
var revinfo = pageinfo;
var revid = revinfo;
var timestamp = revinfo;
var target_time = pastdate + 'T00:00:00Z';
window.location = wgServer + '/w/index.php?oldid=' + revid + '&timetravel=' + target_time;
}
}
}
}
function wpast_setup() {
var tooltip = "Browse Wikipedia as it appeared on a past date";
mw.util.addPortletLink("p-tb", "javascript:seeback()", "Browse in past", "t-past", tooltip, "`");
}
if(typeof sajax_init_object !== 'undefined') {
var api = sajax_init_object();
addOnloadHook(wpast_setup);
}