Initial commit
[provvstudienna.user.js] / provvstudienna.user.js
1 // ==UserScript==
2 // @name        Provveditorato Studi Enna Fix
3 // @description Fix the site from the Provveditorato agli Studi di Enna
4 // @namespace   http://oblomov.myopenid.com
5 // @include     http://provvstudienna.it/*
6 // @include     http://*.provvstudienna.it/*
7 // @author      Giuseppe "Oblomov" Bilotta
8 // @version     20100819
9 // ==/UserScript==
10
11 if (typeof(unsafeWindow) == 'undefined') unsafeWindow = window;
12
13 (function () {
14  var marq = unsafeWindow.document.getElementById('externalmarquee');
15  if (marq) {
16   var url = marq.getAttribute('src').replace(/\\/g,'/');
17   xhr = new XMLHttpRequest();
18   xhr.open("GET", url, true);
19   xhr.onreadystatechange = function() {
20    if (xhr.readyState == 4) {
21     if (xhr.status == 200) {
22      marq.innerHTML = xhr.responseText;
23     } else {
24      marq.innerHTML = 'impossibile caricare le news';
25     }
26    }
27   }
28   xhr.send();
29  }
30  })();