Sterling Technology

The Technology that powers Sterling Adventures
Are you a sheep? Do you just follow the crowd and switch on a MS Windows PC? Or, do you have inspiration, power, reliability, creativity, flair and a Mac! 😉

Lets look at some of the technology I’ve used to make this site what it is. There are three areas I’d like to share, the technology that makes it possible, blogging, and the mechanisms behind my live weather feeds…

Web Technologies
Apple have made it easy for those with no technical know-how to create web content using iWeb.

But for those with more of a technical leaning, use of the following technologies allows you to get really flash (well I think so anyway)…

  • Central to the power is that fact that a Mac is a fully qualified UNIX server.

    UNIX

    For example, the power of UNIX shell scripts are unleashed. These are a UNIX system administrator’s nightmare and blessing all in one.

  • (Perhaps) the most important aspect of the technology is the fact that Macs are:

    Powered by Apache

    With Apache, HTML is (of course) easy – it’s a web server first and foremost. But one other thing is nice when creating dynamic content – and that is server side HTML includes; SHTML.

    Getting Apache going is as simple as one click in the Sharing preferences panel of a Mac’s System Preferences.

    SHTML is a good deal trickier to enable and involves editing the Apache configuration files (use Google for help).

  • Apache also opens the door (easily, as compared to other “lesser” operating systems) to the next big tool:

    PHP

    PHP is a mega powerful way to get stuck into server side scripting.

    It can be a bit strange to get started coding in PHP, but for anyone with C (or other C variants like C++ or Java) programming skills, it’ll come quickly.

    Setting up PHP is a bit involved, but this link sorted me (and loads of others) out.

The other technology used in the pages of Sterling-Adventures is Java Script. A common web technology, but still really powerful for client side scripting.

Especially when the latest AJAX techniques are used to dynamically change content, as used on the Home page news ticker.

See all of the results starting here.

Blogging Technologies
Apple’s iWeb application makes the creation of content super easy. Pages like this, photos, movies, podcasts, blogs, etc. are simple.

However, there are some aspects of iWeb that are a bit tough to get around:

  • Including any of your own HTML. Like a link to the Amazon affiliates programme.

    Although Apple have now made this possible in limited ways.

  • Any other generated content, for example the output from a weather station as described right.
  • Fully featured web logs (blogs). Of course, Apple have now added comments and searching to iWeb, but you also need a .Mac account to use them. Not as cool as your own domain name (and considerably more expensive).

iWeb

Sterling Adventures has chosen to implement WordPress (“a state-of-the-art semantic personal publishing platform”).

Using this technology has brought fast, easily searched, customisable blogging to Sterling Adevntures, and allowed contributors to have far more control of their adventures reports.

WordPress is a feature rich solution that leverages two key technologies – PHP (described left) and MySQL. MySQL is a powerful (and fast) open source relational database used by WordPress to store all the blog data.

These amazing software products (WordPress, PHP, and MySQL) are free to use! How cool is that?

WordPress takes about 5 minutes to install (“the famous 5 minute install”) and offers a completely flexible environment on which to build a blog.

The look of the blog is all controlled by templates (Sterling Adventures has its own template to get as close as possible to the style used across the whole site).

Add to this an array of freely available plug-ins (Askimet spam filtering, Gravatars, database backup, etc.) to enhance and extend the capabilities and the “state-of-the-art” claim made by WordPress starts to make sense.

Check out the results here…

The custom plug-ins etc. are available for download here…

Weather
The Davis Instruments Vantage Pro 2 weather station is the hub of the Sterling weather solution. It’s an awesome weather station, and following Davis’ installation instructions is easy – even setting up the rain gauge for millimetres is straight forward. Why do those silly Yanks still use inches anyway?

The Davis WeatherLink software does a great job, but it is deficient in that it doesn’t expose the forecast information. For many it’ll do fine as-is, but I wanted more – flash icons, up-to-date forecast information, etc. So I searched for a solution to the Davis functionality gap. I found Joe Jaworski’s VPROWEATHER software. The only problem with this is, it’s written for Linux on a PC and the handling of 32 bit data when compiled on a Mac doesn’t work. Some debugging of the C code followed by moving bytes of data 8 bits left using Apple’s X Tools sorted that.

Next, how to automatically update the weather and publish it to the web:

  1. Create a template with WeatherLink and VPROWEATHER tags. There are lots of examples with the Davis software. My template has loads of PHP in it too. This does stuff like display a moon at night and a sun during the day if it’s clear or sunny respectively. So the final output from step 2 is a file with a PHP extension.
  2. Schedule the WeatherLink software to pre-process the template, replace the WeatherLink tags, generate any images required and then place the results in a local directory. Don’t use this software to upload using FTP.
  3. Create a shell script to look if the processed WeatherLink file is in the local directory. If it is:

    • Run VPROWEATHER to fetch data from the Vantage Pro. Then run the tag replacement software. This time the only tags we are replacing are the forecast information, as all the other weather data (e.g. temperature) has been inserted by WeatherLink.
    • Copy the final version of the processed file (and any image files) to the mirror site. This is optional, but it’s probably best to have a copy should the hosted data get trashed…
    • Using FTP (or rsync), copy the same files to the appropriate place on the web hosting service.
  4. Schedule the shell script (using cron) to run regularly.

Finally, thanks to Stardock Icons for the icons that make the weather page a far improved visual experience.

Check out the results here.


Want to know more, or get your hands on some of the code?
e-Mail me (link below, remembering to remove your PANTS) and I’ll do my best to help out…