Create a gist now

Instantly share code, notes, and snippets.

Embed
CiteThis Bookmarklet (Javascript unencoded and uncompressed)
javascript: (function () {
var h = document.createElement('div');
var t = document.getElementsByTagName('title')[0];
var info = '<p><strong>Title(' + t.innerHTML.length + '):</strong> ' + t.innerHTML + '</p>';
var m = document.getElementsByTagName('meta');
for (var i = 0; i < m.length; i++) {
if (null !== m[i].getAttribute('name')) {
var c = m[i].getAttribute('content');
info += '<p><strong>' + m[i].getAttribute('name') + '(' + c.length + '):</strong> ' + c + '</p>';
}
}
var lm = document.lastModified;
var url = location.href;
var d = new Date();
var dd = d.getDate();
var mm = d.getMonth()+1;
var yyyy = d.getFullYear();
info += '<p><strong>Citation: </strong>"' + t.innerHTML + '." Last modified ' + lm + '. ' + url + ' (accessed ' + mm + '/' + dd + '/' + yyyy + ').</p>';
document.body.insertBefore(h, document.body.firstChild);
h.innerHTML = '<div style="border:1px solid #888;border-radius:5px;-moz-box-shadow:0 0 5px #888;-webkit-box-shadow:0 0 5px#888;box-shadow:0 0 5px #888;background:#eee;text-align:left;padding:1em;"><a href="#" onclick="document.body.removeChild(document.body.firstChild);return false">remove</a>' + info + '</div>';
})();
@phette23

This comment has been minimized.

Show comment
Hide comment
@phette23

phette23 Oct 25, 2012

Out of curiosity, how accurate do you think the document.lastModified property is? With this Gist, for instance, it's always showing the current date (probably because of AJAX) even though I can see that your last update was 17 days ago.

Out of curiosity, how accurate do you think the document.lastModified property is? With this Gist, for instance, it's always showing the current date (probably because of AJAX) even though I can see that your last update was 17 days ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment