No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Gstatus displays the latest visitors to your websites on top of a Google Map, the date and time, and how much money you have made on your websites.

Requirements and Dependencies

How It Works

A python script sits and waits for incoming data sent over TCP. The data either represents a website visitor, or the money a website just made. For example, this data packet would indicate a person at IP just visited\n

and this would indicate just made $25.10:

money 25.10\n

The python script parses the information, and in the case of a visitor--identifies the visitor's location using GeoIP--and inserts the data into a database. The index.html polls the update.php page roughly every second, and the update.php pulls the latest data from the database.

The visitors are plotted as little dots on a Google Map, and the daily totals for the websites are tabulated on the side.

After you get it working, it looks pretty cool.



Create a database called IpQueue:


Create two tables in the database:

CREATE TABLE  `IpQueue`.`Money` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `website` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `amount_on` datetime NOT NULL,
  PRIMARY KEY (`id`)

CREATE TABLE  `IpQueue`.`Visitors` (
  `ip_address` varchar(16) NOT NULL,
  `last_visit` datetime NOT NULL,
  `website` varchar(50) NOT NULL,
  `lat` float NOT NULL,
  `long` float NOT NULL,
  PRIMARY KEY (`ip_address`,`website`)


gunzip the GeoLiteCity.dat.gz file and move it to a place where this program can access it (/usr/share/GeoIP for example)

Change the first few lines of to match your database host/username/password and location of your GeoLiteCity.dat file. Also change the LISTEN_ON ip address to match that of your computer.

If you are running on a computer behind a router or firewall, make sure you open up port 8001, and/or forward it to your computer.


Change the first lines to match your database host/username/password.


Add your sites to the configuration, specifying the colors of the dot you want to represent the site, whether you want it to appear on the sidebar where money totals are displayed, and its label.


Replace YOUR_API_KEY with your API key from Google.

Starting the Application

Run python (hopefully you won't get any errors)!

Talking to the Application

You can use the nc command to send simple messages to the application. Some examples (make sure you replace the IP address after 'nc' to your IP):

echo -e "\n" | nc YOUR_IP 8001

If you now open up index.html in your browser, you should see a dot over California.

To send a money message (make sure you replace with a site listed in js/config.js):

echo -e "money 25.10\n" | nc YOUR_IP 8001

index.html should now show that earned $25.10.


If your website servers run Apache, you can edit the LogFormat to show your website's hostname (which makes it work with this program). In apache.conf, change your LogFormat to have a "%{Host}i" at the end:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Host}i\"" combined

Then do something like

tail --follow=name /var/log/apache2/access.log | nc YOUR_IP 8001

Contact Me

This was probably very confusing for you! I'm not a technical writer by trade, so if you need help setting this up, please don't hesitate to email me: