Skip to content

@syranez /Bookmarklet
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
the-kenny braucht Hauptmensa sonst weint er.
var kenny = (function() {
/**
* uri
*
* has to be enhanced with this \d\d\d\d-\d\d\d\d.htm
* @param string
*/
var host = "http://studentenwerk.essen-duisburg.de/speiseplaene/kl_";
var date = null;
var showNextWeek = true;
function getDay () {
if (date === null) {
date = new Date();
}
var day = date.getDate();
if (day < 10) {
return "0" + day;
}
return day;
};
function getMonth () {
if (date === null) {
console.log("month is leer");
date = new Date();
}
var month = date.getMonth();
month += 1;
if (month < 10) {
return "0" + month;
}
return month;
}
return {
getUri: function () {
date = new Date();
var day = date.getDay();
if (showNextWeek) {
if (day === 0) {
date = new Date(date.getTime() + 86400000);
} else if (day === 6) {
date = new Date(date.getTime() + (86400000)*2);
}
}
return host + getDay() + getMonth() + "-" + getDay() + getMonth() + ".htm";
}
};
})();
@syranez
Owner

Use it with
document.location = kenny.getUri();
as bookmarklet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.