Twist on Website Monitoring with Google Docs

I came across this neat Google Apps Script that monitor your website and send you an alert if it is down.

It was not a perfect fit for my needs so I made some modifications to the original script.

  • First, I have hardcoded URL (more than one in an array) in the script. Then I added a FOR loop that checks all the URLs.
  • My email is also hardcoded, it makes the spreadsheet neater.
  • Finally, I only need a flag (entry in the sheet and email) when a site is down. I don’t want to know if it’s up so I filtered out “200″ responses.

One last thing I’ve done in Gmail is adding a filter to highlight the emails sent from the script (Mark as important, starred and add a specific Label).

The email once filtred in Gmail.

The email once filtred in Gmail.

Here is my version of the script, feel free to copy and change as you see fit!

/** Monitor Sites's Uptime **/
/** based on: Site's Uptime **/
/** By Amit Agarwal 26/03/2012 **/
/** http://labnol.org/?p=33232 **/

function isMySiteDown()
{
var url= new Array();
url[0] = "http://one.example.com";
url[1] = "http://two-example.net";
url[2] = "http://www.google.com";

var response, error;

for (var n=url.length-1;n>=0;--n){
try {
response = UrlFetchApp.fetch(url[n]);
} catch(error)
{
var msg = "[UPTIME] " + url[n] + " is DOWN";
insertData(error, -1, msg);
return;
}

var code = response.getResponseCode();

if (code!=200) {
var msg = "[UPTIME] " + url[n] + " is DOWN";
insertData(response.getContent()[0], code, msg);}
};
}

function insertData(error, code, msg) {

var sheet = SpreadsheetApp.getActiveSheet();
var email = "youremail@address.net";
var row = sheet.getLastRow() + 1;

sheet.getRange(row,1).setValue(new Date());
sheet.getRange(row,2).setValue(error);
sheet.getRange(row,3).setValue(code);
sheet.getRange(row,4).setValue(msg);

if (code!=200)
MailApp.sendEmail(email, msg, msg+" "+error);
}
Posted in Internet, Technology | Tagged , , , , | 1 Comment

Photofusion, Dublin new & old

You might have seen these type of photo montage where an old photo is mixed with a new one. This is what we decided to try my daughter and myself.

We got the old photos (1961) from Charles W. Cushman, “An American, [who] travelled the world for 30 years, including a visit to Dublin.“.

The 2 photos I decided to work with are of the front of Trinity College and the Bank Of Ireland building. This corner of Dublin has changed a lot in 50 years, more trees, signs, traffic lights,… Anyway, here are the results.

The first one is a polaroid of the old on top of the new. There were too many elements on the photo to manage a different montage.

The second one is a real mix. Some road, pedestrians and 2 modern Dublin Bus are included in the 1961 street view, this is working well.

You can see another “photofusion” by visiting my daughter’s website.

Raphael

Posted in Photo, Travel | Tagged , , | Comments Off

expansys’ unrealistic stock and status…

See update at the bottom (Thursday 13th October)

I wanted to order a new Canon DSLR. After looking at different online shops, I decided to use expansys for 3 reasons:

  • The prices were similar to all the other shops
  • I have used them a lot before and they always been good in term of price and delivery time
  • they had everything I wanted in stock (very important!).

So, on Friday 23rd of September I placed my order and paid with Paypal. I immediately received the order confirmation… all good, all good! Continue reading

Posted in Internet, Photo, Technology | Tagged , , , , , , | Comments Off

Holidays calendar in Google Spreadsheet with scripting

At work, we found that the easiest way to track holidays (days off) was to use a Google Docs spreadsheet. The only issue we had was to keep track of the days taken by each of us, but scripting came to the rescue!  You can access the spreadsheet in Google Docs from this link. Create a copy and share it as you see fit. The script is in full below with comments but let’s go through some of the interesting parts first.

Continue reading

Posted in Internet, Technology | Tagged , , , , , , , | Comments Off

15 years online!

Last month (February 2011) marked my 15th year anniversary of internet activity. It started at the end of February 1996 on my first Windows computer (Windows 95 was magic… was it not?) and an old 14,400 modem from my Atari’s days.

I had to wait for the price (monthly subscription + local calls) to come down before our family budget could accomodate this large expense. The company was fcnet (they are still in business) and my first email address was very complicated, no one could understand it. It might have been due to the fact that only a few people knew what it was for.

The major milestones:

  • First time online.
  • Dialup for free with no time limit and better speed (V92!) from free.fr.
  • Buying my domain (savina,net) and having an easy to give email address.
  • Cable modem with a decent speed and a fixed monthly cost not linked to the time spent online. Also not using the only phone line in the house, no more busy tone.
  • Broadband coming in Ireland (long-awaited!).
  • Wifi to connect computers and phones to the same connection without cables.
  • Using Google App for email, Docs, Calandar. Stop using an email client.
  • Android smartphone (Nexus One) with g3reat internet access and usable browser.
  • Cable modem with decent web 2.0 speed (30MB).

I am looking forward for the next 15 years, I am not sure what to expect…

Raphael

Posted in Internet, Technology | Tagged , , , , , , , , , | Comments Off

Updated movie collection is online

Using DVDpedia, I have placed online our list of movies.

The template used for the export is Antracite but with some tweaks. First, I have created my own banners using different covers. Then I have changed few things on the index and details page.

The statistics page was not included in this template so I have added it (meta tag and link on the page).

Raphaël

Posted in Internet, Technology | Tagged , , , , , | 1 Comment