Skip to content

Instantly share code, notes, and snippets.

@supahgreg
Created March 24, 2011 17:09
Show Gist options
  • Select an option

  • Save supahgreg/885441 to your computer and use it in GitHub Desktop.

Select an option

Save supahgreg/885441 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @id BoerseFFm
// @name BoerseFFm
// @namespace tests
// @description checking the time changing
// @include http://www.boerse-frankfurt.de/DE/index.aspx?pageID=1
// ==/UserScript==
var clock = document.getElementById("clock");
var h, m, s, time;
var RgEx = /(\d+)\:(\d+)\:(\d+).*/;
if (!clock) return;
setInterval(function() {
RgEx.exec(clock.textContent);
h = RegExp.$1;
m = RegExp.$2;
s = RegExp.$3;
time = h + ":" + m + ":" + s;
if (s%30 !== 0) return;
GM_setClipboard("Time>" + time);
GM_notification("Time>" + time);
GM_log(" text=" + clock.textContent + " >" + time + "<");
}, 1E3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment