Last active
September 23, 2023 15:24
-
-
Save kisPocok/1c1467da61c5393301d9de933c199ac9 to your computer and use it in GitHub Desktop.
Hasznaltauto.hu feltöltés dátumának kijelzése (utolsó sort könyvjelzőként elmenteni és listaoldalon katt)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function exifDate(U) { | |
var X = !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest; | |
X.open('GET', U, false); | |
try{ X.send();}catch(y){} | |
var dt=X.getResponseHeader("Last-Modified"); | |
return new Date(dt).toISOString().slice(0,10).replace(/-/g,"-"); | |
} | |
$("img:not(.pull-right)").map(function(i, img){ | |
$(img).parent().append("<span>Feltöltve: " + exifDate(img.src) + "</span>") | |
}) | |
})(); | |
// Add the next line as a bookmark, click on it any hahu page | |
javascript:(function(){$("img:not(.pull-right)").map(function(e,t){$(t).parent().append("<span>Feltöltve: "+function(e){var t=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");t.open("GET",e,!1);try{t.send()}catch(e){}var n=t.getResponseHeader("Last-Modified");return new Date(n).toISOString().slice(0,10).replace(/-/g,"-")}(t.src)+"</span>")})})(); |
Author
kisPocok
commented
Sep 15, 2023
(function() {
function exifDate(url) {
var X = !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest;
X.open('GET', url, false);
try{
X.send();
} catch(y) {}
var date = X.getResponseHeader("Last-Modified");
return new Date(date).toISOString().slice(0,10).replace(/-/g,"-");
}
function parseDate(str) {
var ymd = str.split('-');
return new Date(ymd[0], ymd[1] - 1, ymd[2]);
}
function countNumberOfDayPassed(oldDate) {
var now = new Date();
return Math.round((now - oldDate) / (1000 * 60 * 60 * 24));
}
$("img:not(.pull-right)").map(function(i, img){
$(img).parent().append("<span>" + exifDate(img.src) + "(" + countNumberOfDayPassed(parseDate(exifDate(img.src))) + " napos)</span>")
})
})();
javascript:(!function(){function n(n){var e=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");e.open("GET",n,!1);try{e.send()}catch(t){}var r=e.getResponseHeader("Last-Modified");return new Date(r).toISOString().slice(0,10).replace(/-/g,"-")}$("img:not(.pull-right)").map(function(e,t){var r,a,p;$(t).parent().append("<span>"+n(t.src)+" ("+(p=(a=(r=n(t.src)).split("-"),new Date(a[0],a[1]-1,a[2])),Math.round((new Date-p)/864e5))+"nap)</span>")})}())()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment