Freeola Internet Get Dotted Domains Blog Guides Forums
Menu

Viewing Thread:
'Adding a "Live Title" to your web site, using a microsummary'

Wed 13/12/06 at 22:35:
cjh
Regular
"It goes so quickly"
Posts: 4,083
Let the user know what’s new - via their bookmark’s Live Title.

The new Mozilla Firefox web browser continues to offer the user the chance to add a particular web site to a list that they can save for later, with a feature known as a bookmark. Such a bookmark is generally identified by a static piece of text (and maybe an icon), known as the bookmark title, which may read as the web sites name (e.g. "Freeola ISP").

However, with the introduction of the Live Title feature, a bookmark can come to life.

What is a Live Title

A Live Title is a bookmark for a particular web site that periodically updates the text associated with it. If a web site offers a Live Title, and a user bookmarks and selected to use it, the text that they see when viewing that bookmark will change from time to time, as set by the web sites microsummary.

Such an example of a Live Title may include:

- Latest competition winner (Freeola gameaday mentioned below).
- Latest news headline(s).
- Latest blog entry.
- The current stock price of your shares.
- Whether you are online or offline.

A Live Title is probably best described as a slimmed down alternative to a Live Bookmark, in that you don’t have to go to the lengths of creating and maintaining a full web feed to keep your visitors up to date with your new site content.

As a web site owner, you have the ability to set the Live Title, by creating your very own microsummary.

What is a microsummary

A microsummary is either a plain text file that contains the text that should appear in the bookmark (handwritten or server-side created), or a generator file, written in XML, that scans a web page and creates the text that should appear in the bookmark title on the fly.

Firefox will check for an updated microsummary every 30 minutes or so. Currently, Firefox is the only web browser to make use of a microsummary as a live title, but the feature may appear in other popular web browsers (such as Opera, Safari, and Internet Explorer) at a later date.

Which microsummary is right for me?

The end result between the two methods is the same; that a user will see your web site bookmark title updated every so often - but the behind the scenes process is quite different. This little article will guide you in the direction of creating either type, and applying them to your web site. But before that, lets see one in action.

Real world example, at freeola.com/gameaday

The Special Reserve Discount Network used to offer its customers the chance to win a game of their choice, every single day - and to this day Freeola continue the competition, with a slightly different prize. Every day, a winner is chosen, and displayed on the Freeola Gameaday home page.

For people who regularly enter the competition, a Live Title is available to them if they choose to bookmark the Freeola Gameaday home page, so that they can see each winner as they are announced within their web browsers bookmarks, rather than having to check the web site daily.

To make use of this Live Title, a user would simply have to go to the Freeola Gameaday web site, and use the bookmark this page (Ctrl+D) option within Firefox.

Usually when adding a bookmark, the name section of the bookmark dialog box will contain the title of the web site, which the user can either manually change, or leave it as it is.

In the case of a Live Title enabled bookmark dialog box, the user will see that the name section contains a drop down menu. Clicking this will display the Live Title option(s), and when selected, will allow the bookmark to be updated with the content from the microsummary.

Freeola have chosen to utilize a Server-side created microsummary for this purpose, but a Client-side microsummary generator option is also available to web site owners, and this tutorial will give you a basic grasp of how to do this for your own web site.

Server-side created microsummary

A site authored microsummary is one that is created and maintained on the web server of the web site in question, with the output being just the text you’d like to be displayed within the bookmark title.

This can be done in a number of ways, which may include using a PHP or CGI script to generate the microsummary, or by simply uploading a plain text (.txt) microsummary file yourself, each time you want to update it.

In the case of Freeola, the microsummary is a plain text file (.txt) that contains the date of the winner, the winners name, and their entry (such as "07/12/06, cjh, Chat Post"). This file is updated daily via a PHP script.

If you have the know-how, you should be able to quickly and easily create a microsummary using PHP or CGI, which should output just the text which you’d like to appear as the Live Title. This microsummary should not contain any HTML, or other mark-up, just plain text.

For example, if you wanted to create a Live Title for your most recent blog entry, you could set the PHP script to just output the blog entry title or heading, which would then appear in the users bookmark, and alert them to the new content.

If your blog entries were stored in a MySQL database, you could code a microsummary script to grab the latest headline only, and output that, allowing the microsummary to always contain the latest headline, without you having to change it manually.

Unfortunately, it is difficult to give PHP and CGI code examples of how to do this here, because of the many different ways a web site may be built. If you have no idea on how to use PHP or CGI, you should look at the Client-side microsummary generator segment below, or ask on the Freeola Web forum for any advice.

Client-side microsummary generator

If you don’t have the ability to create a server-side microsummary, you can instead create a microsummary generator, which will scan your web page and pick out the piece of text you would like to be your live title.

A microsummary generator is put together using three mark-up languages, known as XML, XSLT, and XPath, which can sound like a daunting task, but the majority of the code you’ll need is provided below.

It should be noted that a microsummary generator will consume more bandwidth than a server-side microsummary, because for the generator to function, it needs to download the entire web page each time it checks for an update, whereas a server-side microsummary only has to send out a small piece of text. If your web pages are large, or you expect your live title to be quite popular, you should look in to producing a server-side microsummary. This is especially true if you plan on using a live title for a web site hosted elsewhere which may have a monthly download limit.

Putting together a microsummary generator

As mentioned above, a microsummary generator will scan your web site and grab the piece of text you wish to appear as your live title. This is done using XPath, which can break down a web sites source code (HTML) in to easily digestible segments.

Like the example previously mentioned, if you have a web site blog, which you update every so often, that you’d like to use as your live title, then the latest blog entry heading makes a good candidate. What we’ll do here is try and capture that heading, to use as your live title.

Due to the nature of Firefox, an excellent XPath Checker add-on exists that can make the creation of a microsummary generator a lot easier. You should install it before continuing, as this will be the tool used to get the XPath data from your desired web page.

Our goal is to create a microsumamry that makes the most recent blog entry heading on a web site appear as our Live Title. Naturally, you’ll have to substitute your own information from your own web site.

To begin your microsummary generator, create a new XML file (which you can do in Windows Notepad), calling it for example, summary.xml, and copy and paste the following in to it, which is just generic code that is required (the