Skip to content

Instantly share code, notes, and snippets.

@rjp
Created August 22, 2010 18:55
Show Gist options
  • Save rjp/544132 to your computer and use it in GitHub Desktop.
Save rjp/544132 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name twitter timestamps
// @namespace rjp
// @include http://*twitter.com/*
// ==/UserScript==
var allTimestamps, thisTimestamp;
allTimestamps = document.evaluate("//span[contains(@class,'timestamp')]",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
for (var i=0;i<allTimestamps.snapshotLength;i++) {
var thisTimestamp = allTimestamps.snapshotItem(i);
var nicetime = thisTimestamp.getAttribute('data');
var tval = eval(nicetime);
var mytimezone = new Date(tval);
thisTimestamp.innerHTML = mytimezone;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment