Version 0.3.1
2011-07-05: Disabled. No count of Firefox 5 downloads has been made available by Mozilla.
Explains how to add a near real-time running Firefox 4 download counter to your website or blog.
Update total per download: | millions | |
Update total per second: | millions | |
Update total once (at page load): | millions | |
Full Screen Demo: | Party Counter |
This page explains how to add a near real-time running Firefox download counter to your webpage. There are two ways to do it:
The easiest way to install a download counter on your site is to use the remotely hosted version. For that, you only need to copy and paste the following code into your webpage, there where you want the Firefox download counter to appear:
Proceed with section 3 to further tweak your download counter to your needs.
For a self hosted implementation, you need to download the tar file that contains the following two programs:
fxcounter.pl
- A Perl program that collects the download total directly from the Mozilla feed.
fxcounter_lib.js
- A JavaScript library to process the total and update the relevant parts of your page.
Both these programs are free to use, modify and/or redistribute under the terms of the GNU GPL 3 license. The Perl program, which has to run on your server, has been developed and tested on Linux, the JavaScript code will run in the browsers of your visitors and should run everywhere, it has been tested on many different systems.
You need to edit the fxcounter.pl
script and
set the variable $fxcounter
(under SETTINGS)
to reflect the path of the file on your server.
The path must be identical to the one where you have placed
fxcounter_lib.js
as that file will be trying to
load fxcounter.js
from the directory it is located in
itself.
This is the line to edit:
fxcounter.pl
should then be executed at regular intervals,
for example via the crontab every 10 minutes.
Finally the following code should be placed in the webpage where you
want the download counter to appear.
(Assuming fxcounter_lib.js
is placed in the same directory as
your webpage, otherwise you need to specify the path (or URL) for
fxcounter_lib.js
):
Then proceed to section 3 of this page to find out how to tweak your download counter to your needs.
Notice: Due to changing sources of download counts, self-hosted versions may cease to function when those sources change.
You can tweak many details of the code, to suit your particular needs. We take a look at some of the lines of the code you copied.
By default the download counter updates itself for every estimated download. You can change the update frequency of the download counter, by indicating the number of milliseconds between updates of the total:
or
You can also name the download counter element differently (default ID is
"fxctotal
") but you'll need to start it with that ID as the
first argument for fxcStart
.
You can have several counters on one page as long as each has a unique ID
and each counter is "started" with their own fxcStart
.
Each counter can have its own update frequency.
This line defines the style of the download counter. You may change the style or remove the line entirely and style the download counter by other means.
You can change the thousand separator to your local settings, for example in most of Europe the thousands separator is a dot:
or
This line of the code indicates where the download counter will appear. It has an initial value set to "millions", you can replace that with anything you want, though visitors are unlikely to see it, unless the counter does not start (e.g. JavaScript is turned off).
You can also give the element a different ID (by default it's
fxctotal
), but be sure to start fxcStart
by
with your chosen ID.
And finally you can remove the link to the full screen download counter, by replacing this line with the following line:
Tip: If the total and words around it seem to move slightly from right to left and back set the font-family to a monospace font (or just 'monospace').
The total downloads shown are an estimate (mouse over the totals to see the information on which it is based). The older the source data the less accurate the total will be. The script does check for new data regularly. We also never know for sure if the last published total is accurate as Mozilla updates the timestamp even when the count doesn't update. We discard timestamp only updates, but there is still uncertainty about the actual download rate. We minimize the impact of this problem by using a sliding average.
The software for the download counter was developed by Otto de Voogd. For feedback and bug reports please contact Otto de Voogd by E-mail.
7is7.com | Software | Otto | Travel Stories | Countdown Clock | Firefox | StatEye
New | About | Contact | Connect | Friends | Promotions | Copyright | Advertise