Skip to content

Instantly share code, notes, and snippets.

@clonejo
Created October 30, 2012 14:03
Show Gist options
  • Select an option

  • Save clonejo/3980341 to your computer and use it in GitHub Desktop.

Select an option

Save clonejo/3980341 to your computer and use it in GitHub Desktop.
Campus-Office-Session-Longer
// ==UserScript==
// @name Campus-Office-Session-Longer
// @namespace campus-office-session-longer
// @description Stops session expiration in Campus Office by regularly loading a page in background.
// @include https://www.campus.rwth-aachen.de/office/views/*
// @version 1
// @require http://code.jquery.com/jquery-1.8.2.min.js
// ==/UserScript==
interval = 10*60*1000;
backgroundUrl = "https://www.campus.rwth-aachen.de/office/views/birthday/birthday.asp";
$("body").append('<div id="session-longer" style="position: fixed; right: 0px; bottom: 0px; background-color: white; border: 3px solid black;">Session Longer! next reload in ' + interval/1000 + ' seconds</div>');
setInterval(function() {
$('#session-longer').html("loading...");
$.get(backgroundUrl,
function(data, textStatus, jqXHR) {
$('#session-longer').html("done! next reload in " + interval/1000 + " seconds");
});
}, interval);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment