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.
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
fxcounter.js from the directory it is located in
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.
fxcounter_lib.js is placed in the same directory as
your webpage, otherwise you need to specify the path (or URL) for
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:
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
You can have several counters on one page as long as each has a unique ID
and each counter is "started" with their own
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:
You can also give the element a different ID (by default it's
fxctotal), but be sure to start
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.