Skip to content

Instantly share code, notes, and snippets.

@tgherzog
Created June 4, 2012 22:32
Show Gist options
  • Save tgherzog/2871227 to your computer and use it in GitHub Desktop.
Save tgherzog/2871227 to your computer and use it in GitHub Desktop.
Code Snippets
<?php
# This PHP array specifies alternate country parameters for select World Bank
# APIs. The top-level key is the 2-character country code used on the World Bank data
# website: see http://api.worldbank.org/countries. The corresponding array
# provides alternate value(s) when the default is not recognized. If an
# alternate value is not defined, then the value from
# http://api.worldbank.org/countries may be used
#
# papi_alt_iso2: alternate 2-character country code for the World Bank
# Projects API: http://search.worldbank.org/api/v2/projects
#
# mfr_alt_iso2: alternate 2-character country code for static maps (images)
# from Mapping For Results, e.g., http://maps.worldbank.org/isocode/zr.png
#
# papi_alt_name: alternate country name on the World Bank Projects website:
# used to generate a link to the country page
#
# mfr_alt_link: alternate link to the country page on
# http://maps.worldbank.org
#
# sapi_alt_name: alternate country name on the World Bank Microdata website:
# used to search for the latest micro-data catalog entries
#
# fapi_alt_name: alternate country name on the World Bank Finances website:
# used to search for country-level financial summary data
#
# cckp_alt_iso3: alternate 3-character country code for climate change API
# calls: e.g.,
# http://climatedataapi.worldbank.org/climateweb/rest/v1/country/cru/tas/month/XRK.xml
#
$wb_alt_api_parameters = array(
'AF' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/sa/afghanistan',
),
'AL' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/albania',
),
'DZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/algeria',
),
'AO' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/angola',
),
'AG' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/antigua-and-barbuda',
),
'AR' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/argentina',
),
'AM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/armenia',
),
'AZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/azerbaijan',
),
'BD' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/sa/bangladesh',
),
'BY' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/belarus',
),
'BZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/belize',
),
'BJ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/benin',
),
'BT' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/sa/bhutan',
),
'BO' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/bolivia',
),
'BA' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/bosnia-and-herzegovina',
),
'BW' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/botswana',
),
'BR' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/brazil',
),
'BG' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/bulgaria',
),
'BF' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/burkina-faso',
),
'BI' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/burundi',
),
'KH' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/cambodia',
),
'CM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/cameroon',
),
'CV' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/cape-verde',
),
'CF' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/central-african-republic',
),
'TD' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/chad',
),
'CL' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/chile',
),
'CN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/china',
),
'CO' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/colombia',
),
'KM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/comoros',
),
'CD' => array(
'papi_alt_iso2' => 'ZR',
'mfr_alt_iso2' => 'ZR',
'papi_alt_name' => 'Congo, Democratic Republic of',
'mfr_alt_link' => 'http://maps.worldbank.org/afr/congo-dem-rep',
'fapi_alt_name' => 'Congo, Democratic Republic of',
),
'CG' => array(
'papi_alt_name' => 'Congo, Republic of',
'mfr_alt_link' => 'http://maps.worldbank.org/afr/congo-republic',
'fapi_alt_name' => 'Congo, Republic of',
),
'CR' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/costa-rica',
),
'CI' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/cote-divoire',
'sapi_alt_name' => 'Côte d\'Ivoire',
),
'HR' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/croatia',
),
'CZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/czech-republic',
),
'DJ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/djibouti',
),
'DM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/dominica',
),
'DO' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/dominican-republic',
),
'EC' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/ecuador',
),
'EG' => array(
'papi_alt_name' => 'Egypt, Arab Republic of',
'mfr_alt_link' => 'http://maps.worldbank.org/mena/egypt',
'fapi_alt_name' => 'Egypt, Arab Republic of',
),
'SV' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/el-salvador',
),
'GQ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/equatorial-guinea',
),
'ER' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/eritrea',
),
'ET' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/ethiopia',
),
'FO' => array(
'papi_alt_name' => 'Faroe Islands',
),
'FJ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/fiji',
),
'GA' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/gabon',
),
'GM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/gambia',
),
'GE' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/georgia',
),
'GH' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/ghana',
),
'GD' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/grenada',
),
'GT' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/guatemala',
),
'GN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/guinea',
),
'GW' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/guinea-bissau',
),
'GY' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/guyana',
),
'HT' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/haiti',
),
'HN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/honduras',
),
'HU' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/hungary',
),
'IN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/sa/india',
),
'ID' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/indonesia',
),
'IR' => array(
'papi_alt_name' => 'Iran, Islamic Republic of',
'mfr_alt_link' => 'http://maps.worldbank.org/mena/iran-islamic-republic',
'fapi_alt_name' => 'Iran, Islamic Republic of',
),
'IQ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/iraq',
),
'JM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/jamaica',
),
'JO' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/jordan',
),
'KZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/kazakhstan',
),
'KE' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/kenya',
),
'KI' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/kiribati',
),
'KP' => array(
'papi_alt_name' => 'Korea, Democratic People\'s Republic of',
'fapi_alt_name' => 'Korea, Democratic People\'s Republic of',
),
'KR' => array(
'papi_alt_name' => 'Korea, Republic of',
'mfr_alt_link' => 'http://maps.worldbank.org/eap/korea-republic',
'fapi_alt_name' => 'Korea, Republic of',
),
'KV' => array(
'papi_alt_iso2' => 'XK',
'mfr_alt_link' => 'http://maps.worldbank.org/eca/kosovo',
'ccapi_alt_iso3' => 'XRK',
),
'KG' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/kyrgyz-republic',
),
'LA' => array(
'papi_alt_name' => 'Lao People\'s Democratic Republic',
'mfr_alt_link' => 'http://maps.worldbank.org/eap/lao-pdr',
'fapi_alt_name' => 'Lao People\'s Democratic Republic',
),
'LV' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/latvia',
),
'LB' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/lebanon',
),
'LS' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/lesotho',
),
'LR' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/liberia',
),
'LY' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/libya',
),
'MK' => array(
'papi_alt_name' => 'Macedonia, former Yugoslav Republic of',
'mfr_alt_link' => 'http://maps.worldbank.org/eca/macedonia',
'fapi_alt_name' => 'Macedonia, former Yugoslav Republic',
),
'MG' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/madagascar',
),
'MW' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/malawi',
),
'MY' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/malaysia',
),
'MV' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/sa/maldives',
),
'ML' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/mali',
),
'MR' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/mauritania',
),
'MU' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/mauritius',
),
'MX' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/mexico',
),
'FM' => array(
'papi_alt_name' => 'Micronesia, Federated States of',
),
'MD' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/moldova',
),
'MN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/mongolia',
),
'ME' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/montenegro',
'sapi_alt_name' => 'Serbia and Montenegro',
),
'MA' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/morocco',
),
'MZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/mozambique',
),
'MM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/myanmar',
),
'NA' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/namibia',
),
'NP' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/sa/nepal',
),
'NI' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/nicaragua',
),
'NE' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/niger',
),
'NG' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/nigeria',
),
'PK' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/sa/pakistan',
),
'PW' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/palau',
),
'PA' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/panama',
),
'PG' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/papua-new-guinea',
),
'PY' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/paraguay',
),
'PE' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/peru',
),
'PH' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/philippines',
),
'PL' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/poland',
),
'RO' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/romania',
),
'RU' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/russian-federation',
),
'RW' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/rwanda',
),
'WS' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/samoa',
),
'ST' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/sao-tome-and-principe',
'sapi_alt_name' => 'São Tomé and Principe',
),
'SN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/senegal',
),
'RS' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/serbia',
),
'SC' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/seychelles',
),
'SL' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/sierra-leone',
),
'SB' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/solomon-islands',
),
'SO' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/somalia',
),
'ZA' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/south-africa',
),
'LK' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/sa/srilanka',
),
'KN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/st-kitts-and-nevis',
),
'LC' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/st-lucia',
),
'VC' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/st-vincent-and-the-grenadines',
),
'SD' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/sudan',
),
'SR' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/suriname',
),
'SZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/swaziland',
),
'SY' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/syrian-arab-republic',
'sapi_alt_name' => 'Syria',
),
'TJ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/tajikistan',
),
'TZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/tanzania',
),
'TH' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/thailand',
),
'TL' => array(
'papi_alt_iso2' => 'TP',
'mfr_alt_iso2' => 'TP',
'mfr_alt_link' => 'http://maps.worldbank.org/eap/timor-leste',
),
'TG' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/togo',
),
'TO' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/tonga',
),
'TT' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/trinidad-and-tobago',
),
'TN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/tunisia',
),
'TR' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/turkey',
),
'TM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/turkmenistan',
),
'UG' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/uganda',
),
'UA' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/ukraine',
),
'UY' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/lac/uruguay',
),
'UZ' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eca/uzbekistan',
),
'VU' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/vanuatu',
),
'VE' => array(
'papi_alt_name' => 'Venezuela, Republica Bolivariana de',
'mfr_alt_link' => 'http://maps.worldbank.org/lac/venezuela',
'fapi_alt_name' => 'Venezuela, Republica Bolivariana de',
),
'VN' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/eap/vietnam',
),
'PS' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/mena/west-bank-and-gaza',
),
'YE' => array(
'papi_alt_iso2' => 'RY',
'mfr_alt_iso2' => 'RY',
'papi_alt_name' => 'Yemen, Republic of',
'mfr_alt_link' => 'http://maps.worldbank.org/mena/yemen-republic',
'fapi_alt_name' => 'Yemen, Republic of',
),
'ZM' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/zambia',
),
'ZW' => array(
'mfr_alt_link' => 'http://maps.worldbank.org/afr/zimbabwe',
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment