Main source |
Parsing HistPop, Templates |
Get External Data |
i18n Message file |
HTML (in Javascript) for Layout |
Stylesheet |
The CenPop script is a script based heavily on Joeytje50's AutoWikiBrowser script. The purpose of the script is to speed up the addition and updating of historical census data in the Template:US Census population template to Wikipedia articles about places and counties and minor civil divisions. The current version links in with the Census Bureau's API to enable auto-updating.
At present, the script should probably be usable by others, but I have not yet had the chance to document it properly ...
To install this script on a wiki, put the following code in your JavaScript file (for example Special:MyPage/common.js, or a skin-specific JS file):
importScript('User:Joeytje50/shortLink.js');
if (mw.config.get('wgCanonicalNamespace')+':'+mw.config.get('wgTitle') === 'Project:CenPop/Script')
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:DemocraticLuntz/CenPop.js&action=raw&ctype=text/javascript');
After installation, you can run the script by going to this page.
Note that the above link shows up as a redlink here, but if it has been installed, the script will run as soon as you navigate to that (unoccupied) page.
TODO: needs to be updated.
The data should be formatted using comma-delimited values, and using double-quotes (") to surround the names of places (no quotes should be used for numbers).
For now (this will have to be updated), the first 4 values must be as follows
For now, The 5th value will be the most recent estimate. Note: this all will have to be fixed for 2020 ...
((#get_web_data:url=https://www2.census.gov/programs-surveys/popest/datasets/2010-2016/cities/totals/sub-est2016_1.csv |format=CSV))
Update interface with Census API