NationStates Jolt Archive


Global Stats

Spaam
02-04-2005, 06:14
I took a sample of 5000 nations using a script I wrote, so I could get some global stats. Here is the first lot:

The average population is about 646 with a standard deviation of between 940 million. This gives the population of the world to be about 84 trillion.

Categories:
Inoffensive Centrist Democracy 20.1%
Democratic Socialists 12.6%
Father Knows Best State 11.7%
Iron Fist Consumerists 6.0%
Compulsory Consumerist State 5.7%
Corrupt Dictatorship 5.3%
Corporate Police State 5.1%
Capitalist Paradise 4.8%
New York Times Democracy 4.2%
Left-Leaning College State 4.0%
Psychotic Dictatorship 3.3%
Scandinavian Liberal Paradise 2.9%
Liberal Democratic Socialists 2.2%
Civil Rights Lovefest 1.9%
Moralistic Democracy 1.7%
Authoritarian Democracy 1.2%
Left-wing Utopia 1.1%
Corporate Bordello 1.1%
Capitalizt 0.9%
Right-wing Utopia 0.9%
Anarchy 0.9%
Libertarian Police State 0.7%
Iron Fist Socialists 0.6%
Conservative Democracy 0.4%
Tyranny by Majority 0.3%
Benevolent Dictatorship 0.3%
Free-Market Paradise 0.3%



Here is the script I used to grab the sample (requires Python)


#!/usr/local/bin/python
#
# Spaam's Spiider
#
# Author: http://www.cheekysod.com
# Date: 2 April 2005
# Version: 1.1
#

import urllib
from time import time
from random import randint

NUMNATIONS = 129000
SAMPLE = 5000
DELAY = 3

LISTURL = "http://www.nationstates.net/cgi-bin/index.cgi/page=world/start=%d"
XMLURL = "http://www.nationstates.net/cgi-bin/nationdata.cgi/nation=%s"

TEMPFILE = "temp.html"
XMLFILE = "%d.xml"

POSTSTR = "\"><img"
PRESTR = ".</td><td><a href=\"nation="
LEN = len(PRESTR)

counter = 0
while counter < SAMPLE:

start = randint(0, NUMNATIONS)
urllib.urlretrieve(LISTURL % (start), TEMPFILE)

f = open(TEMPFILE)
for line in f:
p = line.find(PRESTR)
q = line.find(POSTSTR)
if p > -1 and q > -1:
nation = line[p+LEN:q]

last = time()
print "%d %d %s" % (counter, int(last), nation)
urllib.urlretrieve(XMLURL % (nation), XMLFILE % (counter))
counter += 1
while time() < last + DELAY:
pass

f.close()

urllib.urlcleanup()