command: 'cat ./stolaf-base/whentowork-calendar-url.txt | xargs curl --silent',

refreshFrequency: 60000,
lastUpdateTime: undefined,

style: [
	"bottom: 0",
	"left: 50%",
	"width: 25%",
	"text-align: center",
	"border: 0",
	"height: 3%",
	"vertical-align: middle",
	"color: rgba(255, 255, 255, 0.5)",
	"font-weight: 300",
].join('\n'),

render: function(argument) {
	return 'Helpdesk Workers: <span class="last-updated"></span>';
},

update: function(output, domEl) {
	if (!window.sto)             return '';
	if (!window.sto.libs.moment) return '';
	var moment = window.sto.libs.moment;

	window.sto.data.helpers = output;

	this.lastUpdateTime = new Date();
	domEl.querySelector('.last-updated').textContent = moment(this.lastUpdateTime).calendar();
},

@@ -7,14 +7,15 @@
 d: '
-cat ./
+python 
 stol
@@ -36,47 +36,11 @@
 work
--calendar-url.txt %7C xargs curl --silent
+.py
 ',%0A%0A
@@ -61,9 +61,11 @@
 cy: 
-6
+360
 0000
@@ -450,24 +450,71 @@
 to)         
+       return '';%0A%09if (!window.sto.libs.lodash)
     return '
@@ -545,16 +545,19 @@
 .moment)
+   
  return 
@@ -565,79 +565,909 @@
 ';%0A%09
-var moment = window.sto.libs.moment;%0A%0A%09window.sto.data.helpers = output
+if (!window.sto.libs.DOMParser) return '';%0A%0A%09var _      = window.sto.libs.lodash;%0A%09var moment = window.sto.libs.moment;%0A%0A%09var parser = new DOMParser();%0A%09var whenToWork = parser.parseFromString(output, 'text/html');%0A%0A%09// turn the table into an array of objects of the workers%0A%09var table = whenToWork.querySelector('.bwgt %3E table %3E tbody');%0A%0A%09var headers = _.toArray(table.querySelectorAll('tr:first-child td'));%0A%09var keys = _.map(headers, function(heading) %7Breturn heading.textContent%7D);%0A%0A%09var shiftRows = _.toArray(table.querySelectorAll('tr.underline'));%0A%09var shifts = _.chain(shiftRows)%0A%09%09.map(function(row) %7B%0A%09%09%09return _.zipObject(keys, _.chain(row.children).toArray().map('textContent').value())%0A%09%09%7D)%0A%09%09.map(function(shift) %7B%0A%09%09%09return %7B%0A%09%09%09%09name: shift%5B'Scheduled'%5D,%0A%09%09%09%09time: shift%5B'Time'%5D,%0A%09%09%09%7D%0A%09%09%7D)%0A%09%09.groupBy('time')%0A%09%09.toArray()%0A%09%09.first()%0A%09%09.value();%0A%0A%09window.sto.data.shifts = shifts %7C%7C %5B%5D
 ;%0A%0A%09

Update the whenToWork background scraping widget