Module:SportsRankings/data/WBSC World Rankings
Module rating is invalid or not specified. |
Usage
[edit]This template is meant to help quickly update the WBSC World Rankings for all men's national baseball teams of WBSC, displayed in the infobox on each national team article. When given a country code, the template outputs the WBSC World Ranking of a country, along with a movement indicator (increase, decrease, or steady), and by how many spots a country moves, if applicable. The date of the rankings is also listed, along with a reference to the rankings from WBSC's website.
If desired, the WBSC ranking reference can be used elsewhere in the article using the name "WBSC World Rankings" (i.e. <ref name="WBSC World Rankings"/>
).
Parameters
[edit]1
(unnamed): WBSC country codemdy
: Switches dates to month-day-year format
Example
[edit]An example of the code used to display the ranking of Honduras:
{{WBSC World Rankings|HON}}
This code produces the following:
45 1 (18 November 2024)[1]
- ^ "The WBSC World Ranking". WBSC. 18 November 2024. Retrieved 18 November 2024.
Updating
[edit]The main template page is not meant to be updated. The rankings should be updated at Module:SportsRankings/data/WBSC World Rankings. To update the template, first update the day and month (along with the year if necessary) to the date of the current WBSC World Rankings. Then add a country's new position, along with how many spots they moved (e.g. 2 for increase of two positions, 0 for no movement, -5 for decrease of two positions).
All positions can be quickly updated using a spreadsheet. For example, after copying the entire table from WBSC's ranking list, the following formula can be used in an external spreadsheet to generate the code necessary to update the data page (given the WBSC rankings begin in cell A1):
="| {{subst:str sub old|"&B1&"|0|3}} = "&A1&" | {{subst:str sub old|"&B1&"|0|3}}_move = "&E1
The code generated can be saved on the data page, and the rankings will be updated. Once the cache of a national team page is purged, the updated ranking will be displayed.
local data = {}
-- information about other templates used by module
data.templates = { flagged_team_link = "bb" }
-- general information about ranking and website being cited
data.source = {
url = "https://rankings.wbsc.org/list/baseball/men",
title = "The WBSC World Ranking",
website = "WBSC"
}
-- date of latest update and previous one for movement
data.updated = { day = 18, month = 'November', year =2024 }
data.previous = { day = 2, month = 'September', year =2024 }
-- see "Generating code" section on doc page for how to update the rankings
data.rankings = {
{ "Japan", 1, 0, 6866 },
{ "Chinese Taipei", 2, 0, 5498 },
{ "Venezuela", 3, 1, 4846 },
{ "Mexico", 4, -2, 4729 },
{ "United States", 5, 0, 4691 },
{ "South Korea", 6, 0, 4487 },
{ "Netherlands", 7, 0, 3949 },
{ "Panama", 8, 2, 3394 },
{ "Puerto Rico", 9, -1, 3340 },
{ "Cuba", 10, -1, 3096 },
{ "Dominican Republic", 11, 1, 2745 },
{ "Australia", 12, 3, 2476 },
{ "Colombia", 13, -2, 2441 },
{ "Italy", 14, -1, 2214 },
{ "Czech Republic", 15, -1, 2030 },
{ "Nicaragua", 16, 0, 1828 },
{ "Germany", 17, 0, 1399 },
{ "Great Britain", 18, 0, 1326 },
{ "Israel", 19, 0, 1121 },
{ "China", 20, 0, 900 },
{ "France", 21, 0, 888 },
{ "Canada", 22, 0, 856 },
{ "Brazil", 23, 1, 830 },
{ "Spain", 24, -1, 822 },
{ "Belgium", 25, 0, 365 },
{ "Croatia", 26, 0, 317 },
{ "Curaçao", 26, 2, 317 },
{ "Philippines", 28, 4, 316 },
{ "Austria", 29, -2, 295 },
{ "Sweden", 30, -1, 271 },
{ "Argentina", 31, -1, 225 },
{ "Hong Kong", 32, 5, 223 },
{ "Guam", 33, 1, 203 },
{ "South Africa", 34, -3, 180 },
{ "Ukraine", 35, -2, 176 },
{ "Greece", 36, -1, 167 },
{ "Russia", 37, -1, 157 },
{ "Pakistan", 38, 11, 155 },
{ "Switzerland", 39, -1, 139 },
{ "Hungary", 40, -1, 124 },
{ "New Zealand", 41, -1, 113 },
{ "Thailand", 42, 1, 110 },
{ "Slovakia", 43, -2, 106 },
{ "Peru", 44, -2, 99 },
{ "Honduras", 45, -1, 86 },
{ "Palestine", 46, 9, 82 },
{ "Lithuania", 47, -2, 80 },
{ "Uganda", 48, -2, 72 },
{ "Laos", 49, -2, 54 },
{ "El Salvador", 50, -2, 47 },
{ "Chile", 51, -1, 43 },
{ "Sri Lanka", 51, -1, 43 },
{ "Guatemala", 53, -1, 39 },
{ "Costa Rica", 54, 5, 37 },
{ "Ireland", 55, -2, 35 },
{ "Northern Mariana Islands", 56, -2, 33 },
{ "Bulgaria", 57, -2, 30 },
{ "Singapore", 57, -2, 30 },
{ "Bahamas", 59, -1, 29 },
{ "Serbia", 60, 0, 24 },
{ "Belarus", 61, 0, 23 },
{ "Kenya", 61, 0, 23 },
{ "Slovakia", 61, 0, 23 },
{ "US Virgin Islands", 64, 0, 21 },
{ "Bangladesh", 65, 0, 19 },
{ "Ecuador", 65, 0, 19 },
{ "Norway", 67, 0, 17 },
{ "Afghanistan", 68, 0, 14 },
{ "India", 68, 0, 14 },
{ "Nepal", 68, 0, 14 },
{ "Palau", 68, 0, 14 },
{ "Poland", 72, 0, 11 },
{ "Finland", 73, 0, 10 },
{ "Romania", 73, 0, 10 },
{ "Fiji", 75, 0, 8 },
{ "Bolivia", 76, 0, 4 },
{ "Tanzania", 76, 0, 4 },
{ "Solomon Islands", 78, 0, 3 },
{ "Turkey", 78, 0, 3 },
{ "Estonia", 80, 0, 2 },
}
-- list of WBSC country codes
data.alias = {
{ "AFG", "Afghanistan" },
{ "ARG", "Argentina" },
{ "ARM", "Armenia" },
{ "ARU", "Aruba" },
{ "ASA", "American Samoa" },
{ "AUS", "Australia" },
{ "AUT", "Austria" },
{ "BAH", "Bahamas" },
{ "BAN", "Bangladesh" },
{ "BEL", "Belgium" },
{ "BEN", "Benin" },
{ "BER", "Bermuda" },
{ "BHU", "Bhutan" },
{ "BLR", "Belarus" },
{ "BOL", "Bolivia" },
{ "BOT", "Botswana" },
{ "BRA", "Brazil" },
{ "BRU", "Brunei" },
{ "BUL", "Bulgaria" },
{ "BUR", "Burkina Faso" },
{ "CAN", "Canada" },
{ "CHI", "Chile" },
{ "CHN", "China" },
{ "CIV", "Ivory Coast" },
{ "CMR", "Cameroon" },
{ "COD", "Congo DR" },
{ "COK", "Cook Islands" },
{ "COL", "Colombia" },
{ "CPV", "Cape Verde" },
{ "CRC", "Costa Rica" },
{ "CRO", "Croatia" },
{ "CUB", "Cuba" },
{ "CUW", "Curaçao" },
{ "CYP", "Cyprus" },
{ "CZE", "Czech Republic" },
{ "DEN", "Denmark" },
{ "DOM", "Dominican Republic" },
{ "ECU", "Ecuador" },
{ "EGY", "Egypt" },
{ "ESA", "El Salvador" },
{ "ESP", "Spain" },
{ "EST", "Estonia" },
{ "FIJ", "Fiji" },
{ "FIN", "Finland" },
{ "FRA", "France" },
{ "FSM", "Federated States of Micronesia" },
{ "GBR", "Great Britain" },
{ "GEO", "Georgia" },
{ "GER", "Germany" },
{ "GHA", "Ghana" },
{ "GRE", "Greece" },
{ "GUA", "Guatemala" },
{ "GUM", "Guam" },
{ "GUY", "Guyana" },
{ "HAI", "Haiti" },
{ "HKG", "Hong Kong" },
{ "HON", "Honduras" },
{ "HUN", "Hungary" },
{ "INA", "Indonesia" },
{ "IND", "India" },
{ "IRI", "Iran" },
{ "IRL", "Ireland" },
{ "IRQ", "Iraq" },
{ "ISL", "Iceland" },
{ "ISR", "Israel" },
{ "ISV", "US Virgin Islands" },
{ "ITA", "Italy" },
{ "IVB", "British Virgin Islands" },
{ "JAM", "Jamaica" },
{ "JPN", "Japan" },
{ "KEN", "Kenya" },
{ "KOR", "South Korea" },
{ "KOS", "Kosovo" },
{ "KSA", "Saudi Arabia" },
{ "LAO", "Laos" },
{ "LAT", "Lativa" },
{ "LES", "Lesotho" },
{ "LTU", "Lithuania" },
{ "MAS", "Malaysia" },
{ "MDA", "Moldova" },
{ "MEX", "Mexico" },
{ "MGL", "Mongolia" },
{ "MHL", "Marshall Islands" },
{ "MLT", "Malta" },
{ "MNP", "Northern Mariana Islands" },
{ "MYA", "Myanmar" },
{ "NCA", "Nicaragua" },
{ "NCL", "New Caledonia" },
{ "NED", "Netherlands" },
{ "NEP", "Nepal" },
{ "NGR", "Nigeria" },
{ "NOR", "Norway" },
{ "NZL", "New Zealand" },
{ "PAK", "Pakistan" },
{ "PAN", "Panama" },
{ "PER", "Peru" },
{ "PHI", "Philippines" },
{ "PLE", "Palestine" },
{ "PLW", "Palau" },
{ "PNG", "Papua New Guinea" },
{ "POL", "Poland" },
{ "POR", "Portugal" },
{ "PRK", "North Korea" },
{ "PUR", "Puerto Rico" },
{ "ROU", "Romania" },
{ "RSA", "South Africa" },
{ "RUS", "Russia" },
{ "SAM", "Samoa" },
{ "SGP", "Singapore" },
{ "SLE", "Sierra Leone" },
{ "SLO", "Slovenia" },
{ "SMR", "San Marino" },
{ "SOL", "Solomon Islands" },
{ "SRB", "Serbia" },
{ "SRI", "Sri Lanka" },
{ "SUI", "Switzerland" },
{ "SVK", "Slovakia" },
{ "SWE", "Sweden" },
{ "SXM", "Sint Maarten" },
{ "TAN", "Tanzania" },
{ "THA", "Thailand" },
{ "TOG", "Togo" },
{ "TPE", "Chinese Taipei" },
{ "TTO", "Trinidad and Tobago" },
{ "TUN", "Tunisia" },
{ "TUR", "Turkey" },
{ "UGA", "Uganda" },
{ "UKR", "Ukraine" },
{ "USA", "United States" },
{ "VEN", "Venezuela" },
{ "ZAM", "Zambia" },
{ "ZIM", "Zimbabwe" },
}
-- List of WBSC confederations
data.confederation = {
Africa = { "RSA", "UGA", "KEN", "TAN"
},
Americas = { "MEX", "USA", "VEN", "CUB", "DOM", "PAN", "PUR", "COL", "CAN",
"NCA", "BRA", "CUW", "ARG", "PER", "HON", "ESA", "CHI", "GUA", "CRC",
"BAH", "ISV", "ECU", "BOL"
},
Asia = { "JPN", "KOR", "TPE", "CHN", "PHI", "HKG", "PAK", "THA", "PLE",
"LAO", "SRI", "SGP", "BAN", "AFG", "IND", "NEP"
},
Europe = { "NED", "ITA", "CZE", "GER", "GBR", "ISR", "FRA", "ESP", "BEL",
"CRO", "AUT", "SWE", "UKR", "GRE", "RUS", "SUI", "HUN", "SVK", "LTU",
"IRL", "BUL", "SRB", "BLR", "SLO", "NOR", "POL", "FIN", "ROU", "TUR",
"EST"
},
Oceania = { "AUS", "GUM", "NZL", "MNP", "PLW", "FIJ", "SOL"
},
}
return data