Post date: 11-Apr-2012 20:37:27
Google Apps Scripts...
Here's a little something I've been playing with since GTA UK:
function doGet(e) {
var app = UiApp.createApplication();
// Find date, and then calculate different constituent parts
var date = new Date();
var day = date.getDate();
var month = date.getMonth();
var year = date.getYear();
var wday = date.getDay();
// Array to display weekdays instead of numbers
var myweekday=new Array(7);
myweekday[0]="Sunday";
myweekday[1]="Monday";
myweekday[2]="Tuesday";
myweekday[3]="Wednesday";
myweekday[4]="Thursday";
myweekday[5]="Friday";
myweekday[6]="Saturday";
// Array to display month names instead of numbers
var mymonth=new Array(12);
mymonth[0]="January";
mymonth[1]="February";
mymonth[2]="March";
mymonth[3]="April";
mymonth[4]="May";
mymonth[5]="June";
mymonth[6]="July";
mymonth[7]="August";
mymonth[8]="September";
mymonth[9]="October";
mymonth[10]="November";
mymonth[11]="December";
// Construct and format the date
var todayLabel = app.createLabel("Today is " + myweekday[wday] + ", " + day + " " + mymonth[month] + ", " + year + ".")
.setStyleAttribute("fontSize","14px").setStyleAttribute("color","#000099").setStyleAttribute("fontWeight","Bold")
.setStyleAttribute("fontStyle", "Verdana");
// add the label to the app container
app.add(todayLabel);
return app;
}
Now, it may not look like much...
In fact, it does this:
But...
Once you write a gadget which changes, depending on the date...
You can ask a question of the day....
You can display a different photo/diagram/visual prompt every week/day/month
or use something like:
var myRandomNumber = Math.floor(Math.random()*6)+1;
to make it a different, random quote/question/flashcard each time...
You can take it a step further, add buttons to ask a question.
You could automate the Gadget by storing questions/quotes in a spreadsheet for others to update,
or use a Google Apps script to populate a spreadsheet with the names of images stored in a directory
which is used to create the array in the display script on the fly...
You could store the number of responses to each week's question and display a constantly updated chart illustrating
the number of correct responses, or the time to respond, once someone has answered the question.
.