Skip to content

Instantly share code, notes, and snippets.

@adamcameron
Created August 13, 2012 07:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save adamcameron/3337917 to your computer and use it in GitHub Desktop.
Code for generating my medal tables (see: http://bit.ly/RG6FLD)
<cfscript>
// get the medal table from the london2012 site
httpService = new com.adobe.coldfusion.Http(
method = "get",
url = "http://www.london2012.com/medals/medal-count/",
useragent = CGI.HTTP_USER_AGENT
);
// need to set the ACCEPT param otherwise the website things we're a bot, and 403s our request
httpService.addParam(
type = "header",
name = "accept",
value = CGI.HTTP_ACCEPT
);
httpResponse = httpService.send().getPrefix(); // it's not the "prefix" (whatever that is), it's the HTTP RESPONSE
// if we got a proper response, then process it (or just dump out what we DID get at the bottom)
if (httpResponse.responseHeader.status_code == 200){
// find the medal table
markup = httpResponse.fileContent;
medalTableMatch = reMatchNoCase('<div id="overall_medals"[^>]+><table.+?</table></div>', markup);
if (arrayLen(medalTableMatch) >= 1){
medalTableXml = xmlParse(medalTableMatch[1]);
// I've stored the country populations separately, as it's data, not code. The country names in this must match those used by the London 2012 site
populationsJson = fileRead(expandPath("./populations.js"), "UTF-8");
countries = deserializejson(populationsJson);
// this is the list to include in the output table (I list the first three, plus these ones). This is factored-out because I use it in another file, too
include "./watchlist.cfm";
// grab the first three countries from the main table, and add them to the watch list if they're not on it already
allCountries = xmlSearch(medalTableXml, "//td/div/div/a/span[@class='countryName']");
for (i=1; i <= 3; i++){
topThreeCountry = allCountries[i].xmlText;
if (!listFindNoCase(watchList, topThreeCountry)){
watchList = listAppend(watchList, topThreeCountry);
}
}
// now process all the other countries
// this might not be the best xpath query possible, but it works. We swap the actual country name in in place of {country}
templateXPathToMedal = "//td/div/div/a/span[@class='countryName'][text()=""{country}""]/parent::*/parent::*/parent::*/parent::*/following-sibling::*";
// process ALL the countries (not just the watchList) so we can get each country's placing in the table
for (country in countries){
xPathToMedalForCountry = replace(templateXPathToMedal, "{country}", country);
medalsXml = xmlSearch(medalTableXml, xPathToMedalForCountry);
if (arrayLen(medalsXml) >= 3){ // there are a lot of other TDs in that row, but the only ones we want are the GSB ones. Couldn't work out how to get the xpath to only return these ones..?
countries[country].gold = medalsXml[1].xmlText;
countries[country].silver = medalsXml[2].xmlText;
countries[country].bronze = medalsXml[3].xmlText;
}else{
countries[country].gold = 0;
countries[country].silver = 0;
countries[country].bronze = 0;
}
countries[country].total = countries[country].gold + countries[country].silver + countries[country].bronze;
countries[country].ratio = (countries[country].total) / (countries[country].population / 10^6) ; // ie: medals per one million people
}
// order them by the "column" we want to order the display by
countriesInOrder = structSort(countries, "numeric" , "desc", "ratio");
// this has got mark-up in it, so abstract it out
include "./medalTable.cfm";
}else{ // oops, they've changed the format on me...
writeOutput("Couldn't find the medal table!");
writeDump(httpResponse.responseHeader);
}
}else{
writeDump(httpResponse.responseHeader);
}
// from CFLIB
function roundSigFig(number, digits) {
var iLog = 0;
var iTemp = 0;
var fReturn = 0;
if (number != 0) {
iLog = int(Log10(Sgn(number)*number+0.0));
iTemp = round(number / (10 ^ (iLog-digits+1)));
fReturn = iTemp * (10 ^ (iLog-digits+1));
}
return fReturn;
}
function roundPopulation(population){
var pop = thisCountry.population / 10^6;
if (pop >= 100){
return int(pop);
}else{
return roundSigFig(pop, 3);
}
}
</cfscript>
<cfscript>
// get the medal table from the london2012 site
httpService = new com.adobe.coldfusion.Http(
method = "get",
url = "http://www.london2012.com/medals/medal-count/",
useragent = CGI.HTTP_USER_AGENT
);
// need to set the ACCEPT param otherwise the website things we're a bot, and 403s our request
httpService.addParam(
type = "header",
name = "accept",
value = CGI.HTTP_ACCEPT
);
httpResponse = httpService.send().getPrefix(); // it's not the "prefix" (whatever that is), it's the HTTP response
// if we got a proper response, then process it (or just dump out what we DID get at the bottom)
if (httpResponse.responseHeader.status_code == 200){
// find the medal table
markup = httpResponse.fileContent;
medalTableMatch = reMatchNoCase('<div id="overall_medals"[^>]+><table.+?</table></div>', markup);
if (arrayLen(medalTableMatch) >= 1){
medalTableXml = xmlParse(medalTableMatch[1]);
// I've stored the country populations separately, as it's data, not code. The country names in this must match those used by the London 2012 site
teamSizesJson = fileRead(expandPath("./teams.js"), "UTF-8");
countries = deserializejson(teamSizesJson);
// this is the list to include in the output table (I list the first three, plus these ones). This is factored-out because I use it in another file, too
include "./watchlist.cfm";
// grab the first three countries from the main table, and add them to the watch list if they're not on it already
allCountries = xmlSearch(medalTableXml, "//td/div/div/a/span[@class='countryName']");
for (i=1; i <= 3; i++){
topThreeCountry = allCountries[i].xmlText;
if (!listFindNoCase(watchList, topThreeCountry)){
watchList = listAppend(watchList, topThreeCountry);
}
}
// now process all the other countries
// this might not be the best xpath query possible, but it works. We swap the actual country name in in place of {country}
templateXPathToMedal = "//td/div/div/a/span[@class='countryName'][text()=""{country}""]/parent::*/parent::*/parent::*/parent::*/following-sibling::*";
// process ALL the countries (not just the watchList) so we can get each country's placing in the table
for (country in countries){
xPathToMedalForCountry = replace(templateXPathToMedal, "{country}", country);
medalsXml = xmlSearch(medalTableXml, xPathToMedalForCountry);
if (arrayLen(medalsXml) >= 3){ // there are a lot of other TDs in that row, but the only ones we want are the GSB ones. Couldn't work out how to get the xpath to only return these ones..?
countries[country].gold = medalsXml[1].xmlText;
countries[country].silver = medalsXml[2].xmlText;
countries[country].bronze = medalsXml[3].xmlText;
}else{
countries[country].gold = 0;
countries[country].silver = 0;
countries[country].bronze = 0;
}
countries[country].total = countries[country].gold + countries[country].silver + countries[country].bronze;
countries[country].ratio = (countries[country].total) / (countries[country].size) ; // ie: medals per one million people
}
// order them by the "column" we want to order the display by
countriesInOrder = structSort(countries, "numeric" , "desc", "ratio");
// this has got mark-up in it, so abstract it out
include "./medalTableByTeamSize.cfm";
}else{ // oops, they've changed the format on me...
writeOutput("Couldn't find the medal table!");
writeDump(httpResponse.responseHeader);
}
}else{
writeDump(httpResponse.responseHeader);
}
</cfscript>
<cfset CRLF = chr(13) & chr(10)>
<cfsavecontent variable="rendered">
<cfsetting enablecfoutputonly="true">
<cfoutput>
<style>
<!--- these are inline because I actually need the styles, not a CSS link due to a vagary of the blog --->
<cfinclude template="./styles.css">
</style>
</cfoutput>
<cfoutput><table border="0" cellpadding="0" cellspacing="0" valign="top"></cfoutput>
<cfoutput><thead></cfoutput>
<cfoutput><tr></cfoutput>
<cfoutput><th>Place</th></cfoutput>
<cfoutput><th>Country</th></cfoutput>
<cfoutput><th>&nbsp;G&nbsp;</th></cfoutput>
<cfoutput><th>&nbsp;S&nbsp;</th></cfoutput>
<cfoutput><th>&nbsp;B&nbsp;</th></cfoutput>
<cfoutput><th>Total</th></cfoutput>
<cfoutput><th>Pop. (M)</th></cfoutput>
<cfoutput><th>Ratio</th></cfoutput>
<cfoutput></tr></cfoutput>
<cfoutput></thead></cfoutput>
<cfoutput><tbody></cfoutput>
<cfset rowToggle=0>
<cfloop index="i" from="1" to="#arrayLen(countriesInOrder)#">
<cfset country = countriesInOrder[i]>
<cfif i LE 3 or listFindNoCase(watchList, country)>
<cfset thisCountry = countries[country]>
<cfoutput><tr<cfif rowToggle++ mod 2> class="odd"</cfif>></cfoutput>
<cfoutput><td><cfif thisCountry.total>#i#<cfelse>-</cfif></td></cfoutput>
<cfoutput><td>#Country#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.gold#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.silver#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.bronze#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.total#</td></cfoutput>
<cfoutput><td class="centre">#roundPopulation(thisCountry.population)#</td></cfoutput>
<cfoutput><td class="centre">#decimalFormat(thisCountry.ratio)#</td></cfoutput>
<cfoutput></tr></cfoutput>
</cfif>
</cfloop>
<cfoutput></tbody></cfoutput>
<cfoutput></table>#CRLF##CRLF#</cfoutput>
<cfsetting enablecfoutputonly="false">
</cfsavecontent>
<!--- abbreviate some of the names for the sake of table-formatting --->
<cfset rendered = replaceList(rendered, "United States of America,People's Republic of China,Great Britain,New Zealand,Russian Federation,Republic of Moldova,Democratic People's Republic of Korea,Republic of Korea", "USA,China,GB,NZ,Russia,Moldova,North Korea,South Korea")>
<cfoutput>#rendered#</cfoutput>
<cfset CRLF = chr(13) & chr(10)>
<cfsavecontent variable="rendered">
<cfsetting enablecfoutputonly="true">
<cfoutput>
<style>
<!--- these are inline because I actually need the styles, not a CSS link due to a vagary of the blog --->
<cfinclude template="./styles.css">
</style>
</cfoutput>
<cfoutput><table border="0" cellpadding="0" cellspacing="0" valign="top"></cfoutput>
<cfoutput><thead></cfoutput>
<cfoutput><tr></cfoutput>
<cfoutput><th>Place</th></cfoutput>
<cfoutput><th>Country</th></cfoutput>
<cfoutput><th>&nbsp;G&nbsp;</th></cfoutput>
<cfoutput><th>&nbsp;S&nbsp;</th></cfoutput>
<cfoutput><th>&nbsp;B&nbsp;</th></cfoutput>
<cfoutput><th>Total</th></cfoutput>
<cfoutput><th>Team Size</th></cfoutput>
<cfoutput><th>Ratio</th></cfoutput>
<cfoutput></tr></cfoutput>
<cfoutput></thead></cfoutput>
<cfoutput><tbody></cfoutput>
<cfset rowToggle=0>
<cfloop index="i" from="1" to="#arrayLen(countriesInOrder)#">
<cfset country = countriesInOrder[i]>
<cfif i LE 3 or listFindNoCase(watchList, country)>
<cfset thisCountry = countries[country]>
<cfoutput><tr<cfif rowToggle++ mod 2> class="odd"</cfif>></cfoutput>
<cfoutput><td><cfif thisCountry.total>#i#<cfelse>-</cfif></td></cfoutput>
<cfoutput><td>#Country#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.gold#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.silver#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.bronze#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.total#</td></cfoutput>
<cfoutput><td class="centre">#thisCountry.size#</td></cfoutput>
<cfoutput><td class="centre">#decimalFormat(thisCountry.ratio)#</td></cfoutput>
<cfoutput></tr></cfoutput>
</cfif>
</cfloop>
<cfoutput></tbody></cfoutput>
<cfoutput></table>#CRLF##CRLF#</cfoutput>
<cfsetting enablecfoutputonly="false">
</cfsavecontent>
<!--- abbreviate some of the names for the sake of table-formatting --->
<cfset rendered = replaceList(rendered, "United States of America,People's Republic of China,Great Britain,New Zealand,Russian Federation,Republic of Moldova,Democratic People's Republic of Korea,Republic of Korea", "USA,China,GB,NZ,Russia,Moldova,North Korea,South Korea")>
<cfoutput>#rendered#</cfoutput>
{
"People's Republic of China": {"population":"1347350000"},
"India": {"population":"1210193422"},
"United States of America": {"population":"313992000"},
"Indonesia": {"population":"237641326"},
"Brazil": {"population":"192376496"},
"Pakistan": {"population":"180218000"},
"Nigeria": {"population":"166629000"},
"Bangladesh": {"population":"152518015"},
"Russian Federation": {"population":"143117000"},
"Japan": {"population":"127530000"},
"Mexico": {"population":"112336538"},
"Philippines": {"population":"92337852"},
"Vietnam": {"population":"87840000"},
"Ethiopia": {"population":"84320987"},
"Egypt": {"population":"82418000"},
"Germany": {"population":"81859000"},
"Iran": {"population":"75149669"},
"Turkey": {"population":"74724269"},
"Democratic Republic of Congo": {"population":"69575000"},
"Thailand": {"population":"65479453"},
"France": {"population":"65350000"},
"Great Britain": {"population":"62262000"},
"Italy": {"population":"60813326"},
"South Africa": {"population":"50586757"},
"Burma": {"population":"48724000"},
"Republic of Korea": {"population":"48580000"},
"Colombia": {"population":"46622000"},
"Spain": {"population":"46185697"},
"Ukraine": {"population":"45589171"},
"Tanzania": {"population":"43188000"},
"Kenya": {"population":"42749000"},
"Argentina": {"population":"40117096"},
"Poland": {"population":"38501000"},
"Algeria": {"population":"37100000"},
"Canada": {"population":"34869600"},
"Iraq": {"population":"33330000"},
"Uganda": {"population":"32939800"},
"Morocco": {"population":"32622500"},
"Sudan": {"population":"30894000"},
"Peru": {"population":"30135875"},
"Uzbekistan": {"population":"29123400"},
"Malaysia": {"population":"28334135"},
"Venezuela": {"population":"27150095"},
"Saudi Arabia": {"population":"27136977"},
"Nepal": {"population":"26620809"},
"Afghanistan": {"population":"25500100"},
"Ghana": {"population":"24658823"},
"Democratic People's Republic of Korea": {"population":"24554000"},
"Yemen": {"population":"24527000"},
"Mozambique": {"population":"23700715"},
"Chinese Taipei": {"population":"23261747"},
"Australia": {"population":"22682201"},
"Syria": {"population":"21675000"},
"Madagascar": {"population":"20696070"},
"Angola": {"population":"20609294"},
"Ivory Coast": {"population":"20595000"},
"Sri Lanka": {"population":"20277597"},
"Cameroon": {"population":"19406100"},
"Romania": {"population":"19042936"},
"Chile": {"population":"17402630"},
"Netherlands": {"population":"16736075"},
"Kazakhstan": {"population":"16734000"},
"Mali": {"population":"16319000"},
"Niger": {"population":"16274738"},
"Malawi": {"population":"15883000"},
"Burkina Faso": {"population":"15730977"},
"Guatemala": {"population":"14713763"},
"Ecuador": {"population":"14483499"},
"Cambodia": {"population":"14478000"},
"Zambia": {"population":"13046508"},
"Zimbabwe": {"population":"13014000"},
"Senegal": {"population":"12855153"},
"Chad": {"population":"11831000"},
"Cuba": {"population":"11247925"},
"Belgium": {"population":"10951266"},
"Greece": {"population":"10787690"},
"Rwanda": {"population":"10718379"},
"Tunisia": {"population":"10673800"},
"Portugal": {"population":"10561614"},
"Czech Republic": {"population":"10504203"},
"Guinea": {"population":"10481000"},
"Bolivia": {"population":"10426154"},
"Haiti": {"population":"10085214"},
"Hungary": {"population":"9962000"},
"Somalia": {"population":"9797000"},
"Sweden": {"population":"9495113"},
"Belarus": {"population":"9458500"},
"Dominican Republic": {"population":"9445281"},
"Benin": {"population":"9352000"},
"Azerbaijan": {"population":"9235100"},
"Burundi": {"population":"8749000"},
"Austria": {"population":"8452835"},
"Honduras": {"population":"8385072"},
"United Arab Emirates": {"population":"8264070"},
"South Sudan": {"population":"8260490"},
"Switzerland": {"population":"7952600"},
"Israel": {"population":"7879500"},
"Tajikistan": {"population":"7800000"},
"Bulgaria": {"population":"7364570"},
"Serbia": {"population":"7120666"},
"Hong Kong": {"population":"7103700"},
"Papua New Guinea": {"population":"7014000"},
"Libya": {"population":"6469000"},
"Laos": {"population":"6465800"},
"Paraguay": {"population":"6337127"},
"Jordan": {"population":"6327600"},
"Togo": {"population":"6191155"},
"El Salvador": {"population":"6183000"},
"Sierra Leone": {"population":"6126000"},
"Nicaragua": {"population":"5815524"},
"Denmark": {"population":"5584758"},
"Eritrea": {"population":"5581000"},
"Kyrgyzstan": {"population":"5477600"},
"Slovakia": {"population":"5445324"},
"Finland": {"population":"5413250"},
"Singapore": {"population":"5183700"},
"Turkmenistan": {"population":"5170000"},
"Norway": {"population":"5025600"},
"Ireland": {"population":"4588252"},
"Central African Republic": {"population":"4576000"},
"Georgia": {"population":"4497600"},
"New Zealand": {"population":"4434060"},
"Costa Rica": {"population":"4301712"},
"Palestinian territories": {"population":"4293309"},
"Lebanon": {"population":"4292000"},
"Croatia": {"population":"4290612"},
"Liberia": {"population":"4245000"},
"Congo": {"population":"4140000"},
"Palestine": {"population":"4019433"},
"Bosnia and Herzegovina": {"population":"3839737"},
"Puerto Rico": {"population":"3725789"},
"Kuwait": {"population":"3582054"},
"Republic of Moldova": {"population":"3559500"},
"Panama": {"population":"3405813"},
"Mauritania": {"population":"3378254"},
"Armenia": {"population":"3268500"},
"Uruguay": {"population":"3251526"},
"Lithuania": {"population":"3187700"},
"Mongolia": {"population":"2844000"},
"Albania": {"population":"2831741"},
"Oman": {"population":"2773479"},
"Jamaica": {"population":"2705827"},
"Namibia": {"population":"2364000"},
"Lesotho": {"population":"2217000"},
"Latvia": {"population":"2070371"},
"Slovenia": {"population":"2057780"},
"Macedonia": {"population":"2057284"},
"Botswana": {"population":"2038228"},
"Gambia": {"population":"1825000"},
"Qatar": {"population":"1699435"},
"Guinea-Bissau": {"population":"1580000"},
"Gabon": {"population":"1564000"},
"Trinidad and Tobago": {"population":"1317714"},
"Estonia": {"population":"1294236"},
"Mauritius": {"population":"1286051"},
"Bahrain": {"population":"1234571"},
"Swaziland": {"population":"1220000"},
"East Timor": {"population":"1066409"},
"Djibouti": {"population":"923000"},
"Fiji": {"population":"876000"},
"Cyprus": {"population":"838897"},
"Guyana": {"population":"784894"},
"Comoros": {"population":"773000"},
"Equatorial Guinea": {"population":"740000"},
"Bhutan": {"population":"720679"},
"Montenegro": {"population":"620029"},
"Solomon Islands": {"population":"553935"},
"Western Sahara": {"population":"567000"},
"Suriname": {"population":"534000"},
"Luxembourg": {"population":"511800"},
"Cape Verde": {"population":"491875"},
"Brunei": {"population":"422700"},
"Malta": {"population":"417617"},
"Bahamas": {"population":"353658"},
"Iceland": {"population":"320060"},
"Maldives": {"population":"317280"},
"Belize": {"population":"312971"},
"Barbados": {"population":"274200"},
"Vanuatu": {"population":"252000"},
"Samoa": {"population":"186340"},
"São Tomé and Príncipe": {"population":"172000"},
"Saint Lucia": {"population":"166526"},
"Guam": {"population":"159358"},
"Saint Vincent and the Grenadines": {"population":"109000"},
"Virgin Islands": {"population":"106405"},
"Grenada": {"population":"105000"},
"Tonga": {"population":"103036"},
"Micronesia": {"population":"102624"},
"Aruba": {"population":"101484"},
"Kiribati": {"population":"101000"},
"Seychelles": {"population":"90945"},
"Antigua and Barbuda": {"population":"86295"},
"Andorra": {"population":"78115"},
"American Samoa": {"population":"55519"},
"Cayman Islands": {"population":"55456"},
"Dominica": {"population":"71293"},
"Bermuda": {"population":"64237"},
"Marshall Islands": {"population":"54305"},
"Saint Kitts and Nevis": {"population":"54000"},
"Liechtenstein": {"population":"36476"},
"Monaco": {"population":"35881"},
"San Marino": {"population":"32312"},
"British Virgin Islands": {"population":"24000"},
"Palau": {"population":"21000"},
"Cook Islands": {"population":"17791"},
"Nauru": {"population":"10000"},
"Tuvalu":{"population":"10000"}
}
{
"Great Britain": {"size":"542"},
"United States of America": {"size":"530"},
"Russian Federation": {"size":"436"},
"Australia": {"size":"410"},
"Germany": {"size":"392"},
"People's Republic of China": {"size":"386"},
"France": {"size":"333"},
"Japan": {"size":"293"},
"Italy": {"size":"284"},
"Spain": {"size":"282"},
"Canada": {"size":"277"},
"Brazil": {"size":"259"},
"Republic of Korea": {"size":"245"},
"Ukraine": {"size":"240"},
"Poland": {"size":"217"},
"New Zealand": {"size":"184"},
"Netherlands": {"size":"178"},
"Belarus": {"size":"166"},
"Hungary": {"size":"158"},
"Argentina": {"size":"137"},
"Sweden": {"size":"134"},
"Czech Republic": {"size":"133"},
"South Africa": {"size":"125"},
"Belgium": {"size":"115"},
"Serbia": {"size":"115"},
"Kazakhstan": {"size":"114"},
"Turkey": {"size":"114"},
"Denmark": {"size":"113"},
"Egypt": {"size":"113"},
"Cuba": {"size":"110"},
"Croatia": {"size":"108"},
"Colombia": {"size":"105"},
"Greece": {"size":"105"},
"Romania": {"size":"103"},
"Mexico": {"size":"102"},
"Switzerland": {"size":"102"},
"Tunisia": {"size":"83"},
"India": {"size":"81"},
"Portugal": {"size":"75"},
"Austria": {"size":"70"},
"Morocco": {"size":"69"},
"Venezuela": {"size":"69"},
"Ireland": {"size":"66"},
"Slovenia": {"size":"65"},
"Norway": {"size":"64"},
"Bulgaria": {"size":"63"},
"Lithuania": {"size":"62"},
"Finland": {"size":"55"},
"Nigeria": {"size":"55"},
"Uzbekistan": {"size":"54"},
"Azerbaijan": {"size":"53"},
"Iran": {"size":"53"},
"Democratic People's Republic of Korea": {"size":"51"},
"Jamaica": {"size":"50"},
"Kenya": {"size":"47"},
"Latvia": {"size":"46"},
"Slovakia": {"size":"46"},
"Chinese Taipei": {"size":"44"},
"Hong Kong": {"size":"42"},
"Algeria": {"size":"39"},
"Israel": {"size":"37"},
"Thailand": {"size":"37"},
"Ecuador": {"size":"36"},
"Chile": {"size":"35"},
"Dominican Republic": {"size":"35"},
"Ethiopia": {"size":"35"},
"Georgia": {"size":"35"},
"Angola": {"size":"34"},
"Cameroon": {"size":"33"},
"Estonia": {"size":"33"},
"Montenegro": {"size":"33"},
"Senegal": {"size":"31"},
"Trinidad and Tobago": {"size":"31"},
"Malaysia": {"size":"30"},
"Mongolia": {"size":"29"},
"Uruguay": {"size":"29"},
"Honduras": {"size":"27"},
"Iceland": {"size":"27"},
"United Arab Emirates": {"size":"26"},
"Armenia": {"size":"25"},
"Gabon": {"size":"24"},
"Puerto Rico": {"size":"24"},
"Bahamas": {"size":"23"},
"Singapore": {"size":"23"},
"Republic of Moldova": {"size":"22"},
"Indonesia": {"size":"21"},
"Pakistan": {"size":"21"},
"Guatemala": {"size":"19"},
"Saudi Arabia": {"size":"19"},
"Vietnam": {"size":"18"},
"Peru": {"size":"16"},
"Tajikistan": {"size":"16"},
"Uganda": {"size":"16"},
"Bahrain": {"size":"14"},
"Kyrgyzstan": {"size":"14"},
"Cyprus": {"size":"13"},
"Eritrea": {"size":"12"},
"Qatar": {"size":"12"},
"Albania": {"size":"11"},
"Costa Rica": {"size":"11"},
"Kuwait": {"size":"11"},
"Mauritius": {"size":"11"},
"Philippines": {"size":"11"},
"El Salvador": {"size":"10"},
"Ivory Coast": {"size":"10"},
"Grenada": {"size":"10"},
"Lebanon": {"size":"10"},
"Syria": {"size":"10"},
"Turkmenistan": {"size":"10"},
"Fiji": {"size":"9"},
"Ghana": {"size":"9"},
"Luxembourg": {"size":"9"},
"Jordan": {"size":"9"},
"Namibia": {"size":"9"},
"Bermuda": {"size":"8"},
"Cook Islands": {"size":"8"},
"Guam": {"size":"8"},
"Iraq": {"size":"8"},
"Papua New Guinea": {"size":"8"},
"Paraguay": {"size":"8"},
"Samoa": {"size":"8"},
"Zambia": {"size":"8"},
"Zimbabwe": {"size":"8"},
"Congo": {"size":"7"},
"Madagascar": {"size":"7"},
"Panama": {"size":"7"},
"Rwanda": {"size":"7"},
"Saint Kitts and Nevis": {"size":"7"},
"Sri Lanka": {"size":"7"},
"Tanzania": {"size":"7"},
"Virgin Islands": {"size":"7"},
"Afghanistan": {"size":"6"},
"Andorra": {"size":"6"},
"Barbados": {"size":"6"},
"Bosnia and Herzegovina": {"size":"6"},
"Burundi": {"size":"6"},
"Cambodia": {"size":"6"},
"Central African Republic": {"size":"6"},
"Djibouti": {"size":"6"},
"Guyana": {"size":"6"},
"Libya": {"size":"6"},
"Mali": {"size":"6"},
"Micronesia": {"size":"6"},
"Monaco": {"size":"6"},
"Mozambique": {"size":"6"},
"Burma": {"size":"6"},
"Nicaragua": {"size":"6"},
"Niger": {"size":"6"},
"Seychelles": {"size":"6"},
"Sudan": {"size":"6"},
"Togo": {"size":"6"},
"Antigua and Barbuda": {"size":"5"},
"American Samoa": {"size":"5"},
"Bangladesh": {"size":"5"},
"Benin": {"size":"5"},
"Bolivia": {"size":"5"},
"Burkina Faso": {"size":"5"},
"Cayman Islands": {"size":"5"},
"Haiti": {"size":"5"},
"Maldives": {"size":"5"},
"Malta": {"size":"5"},
"Nepal": {"size":"5"},
"Palau": {"size":"5"},
"Palestine": {"size":"5"},
"Suriname": {"size":"5"},
"Vanuatu": {"size":"5"},
"Aruba": {"size":"4"},
"Botswana": {"size":"4"},
"Democratic Republic of Congo": {"size":"4"},
"Guinea": {"size":"4"},
"Guinea-Bissau": {"size":"4"},
"Lesotho": {"size":"4"},
"Liberia": {"size":"4"},
"Macedonia": {"size":"4"},
"Marshall Islands": {"size":"4"},
"Oman": {"size":"4"},
"Saint Lucia": {"size":"4"},
"San Marino": {"size":"4"},
"Solomon Islands": {"size":"4"},
"Yemen": {"size":"4"},
"Belize": {"size":"3"},
"Brunei": {"size":"3"},
"Cape Verde": {"size":"3"},
"Chad": {"size":"3"},
"Comoros": {"size":"3"},
"Kiribati": {"size":"3"},
"Laos": {"size":"3"},
"Liechtenstein": {"size":"3"},
"Malawi": {"size":"3"},
"Netherlands Antilles - Independent Olympic Participants (IOP)": {"size":"3"},
"Saint Vincent and The Grenadines": {"size":"3"},
"Swaziland": {"size":"3"},
"Tonga": {"size":"3"},
"Tuvalu": {"size":"3"},
"Bhutan": {"size":"2"},
"British Virgin Islands": {"size":"2"},
"Dominica": {"size":"2"},
"East Timor": {"size":"2"},
"Equatorial Guinea": {"size":"2"},
"Gambia": {"size":"2"},
"Mauritania": {"size":"2"},
"Nauru": {"size":"2"},
"São Tomé and Príncipe": {"size":"2"},
"Sierra Leone": {"size":"2"},
"Somalia": {"size":"2"},
"South Sudan": {"size":"1"}
}
<cfsavecontent variable="watchlist">
Australia
Belgium
Brazil
Canada
Czech Republic
Denmark
France
Germany
Great Britain
India
Ireland
Israel
Italy
Japan
Latvia
Mexico
Netherlands
New Zealand
Pakistan
Philippines
Poland
Republic of Korea
Republic of Moldova
Russian Federation
Singapore
Switzerland
United States of America
Ukraine
</cfsavecontent>
<cfset watchList = listChangeDelims(watchList, ",", chr(13) & chr(10))>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment