Blog    Notes   

Simple Progress Bar

Version: 0.1 alpha
Author: Susam Pal
License: GPLv3

Download Download

I wrote this ten minute hack just now to create a URL that is a configurable progress bar. I will add more options to it and write more information about it soon when I get time. For the time being, here are simple tips on how to use it.

I created this to display progress bar against the tasks I am tracking in a Confluence based internal wiki. I wanted an URL that I can use as a configurable progress bar image. The URL of this project page is the solution I came up with.

The URL of this page be used just like any image if you use it with a query parameter 'n'. On, using this parameter, you get an image instead of this page.

For example, check this: http://susam.in/progress/?n=60.

So, in web pages, it can be easily used with the img tag. For example, to display a progress of 20%, you would simply include this.

<img src="http://susam.in/progress/?n=20" alt="Progress" title="Progress">

The result would be: Progress

It uses the PHP GD library to draw the image. So, for this script to work on your server, your PHP must be configured with GD. The installation and configuration details are available in the PHP manual. If you are using a commercial hosting server, most likely it already has it. On Debian GNU/Linux, the library can be installed easily with the command: aptitude install php5-gd.