Skip to content

Instantly share code, notes, and snippets.

@SeanMcP
Last active August 21, 2018 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanMcP/2f3bf3383d9eeadb810b383eb877ee38 to your computer and use it in GitHub Desktop.
Save SeanMcP/2f3bf3383d9eeadb810b383eb877ee38 to your computer and use it in GitHub Desktop.
Get an array of clubs from NPSL team list
//========
// 2019
//========
// Perhaps this is the same as 2018. I can't remember.
$$('h6[style="text-align: center;"]').map(item => {
if (item.innerText.includes('\n')) return item.innerText.split('\n')[0];
return item.innerText;
})
//========
// 2018
//========
// They don't use classes, so anchors with rel=noopener seems to be the most unique characteristic of each team
[...document.querySelectorAll('a[rel=noopener]')]
.map(item => item.textContent)
.filter(item => item.length > 0 && item.toLowerCase() !== 'tickets');
const list2018 = ["Cleveland SC", "Erie Commodores FC", "FC Buffalo", "Fort Pitt Regiment", "Greater Binghamton FC Thunder", "Rochester Lancers", "Syracuse FC", "AFC Ann Arbor", "Detroit City FC", "FC Columbus", "FC Indiana", "Grand Rapids FC", "Kalamazoo FC", "MIlwaukee Torrent", "Dakota Fusion FC", "Duluth FC", "LC Aris FC", "Med City FC", "Minneapolis City SC", "Minnesota TwinStars FC", "Sioux Falls Thunder FC", "VSLT FC", "Atlantic City FC", "Electric City Shock", "FC Monmouth", "FC Motown", "Hershey FC", "Junior Lone Star FC", "New Jersey Copa FC", "Torch FC", "West Chester United SC", "Charlottesville Alliance FC", "FC Baltimore", "FC Frederick", "Legacy 76", "Northern Virginia United", "Virginia Beach City FC", "Boston City FC", "Brooklyn Italians", "Elm City Express", "Greater Lowell NPSL FC", "Hartford City FC", "Kingston Stockade FC", "New York Athletic Club", "New York Cosmos B", "Rhode Island Reds FC", "Seacoast United Mariners", "TSF FC", "Demize NPSL", "FC Wichita", "Little Rock Rangers", "Ozark FC", "Saint Louis Club Atletico", "Tulsa Athletic", "Dutch Lions FC", "FC Brownsville", "Fort Worth Vaqueros FC", "Houston Regals SCA", "Katy 1895 FC", "Laredo Heat SC", "Midland-Odessa Sockers FC", "Shreveport Rafters FC", "Tyler FC", "Asheville City SC", "Atlanta SIlverbacks FC", "Chattanooga FC", "Emerald Force SC", "Georgia Revolution FC", "Greenville FC", "Inter Nashville FC", "New Orleans Jesters", "Boca Raton FC", "Jacksonville Armada FC", "Miami FC 2", "Miami United FC", "Naples United FC", "Palm Beach United", "Storm FC", "Academica SC", "CD Aguiluchos USA", "East Bay FC Stompers", "El Farolito", "FC Davis", "Napa Valley 1839 FC", "Sacramento Gold FC", "Sonoma County Sol FC", "FCM Portland", "Kitsap Pumas", "OSA FC", "PDX FC", "Spokane SC Shadow", "ASC San Diego", "FC Arizona", "FC Golden State", "Orange County FC", "Oxnard Guerreros FC", "Riverside Coras", "Temecula FC"];
//========
// 2017
//========
// Just a bunch of anchords within paragraphs within table cells
[...document.querySelectorAll('.team_directory2017 a')]
.map(item => item.textContent.trim().replace(/(\r\n\t|\n|\r\t)/gm,'').replace(/\s+/g,' ').trim())
.filter(item => item.length > 0 && item.toLowerCase() !== 'tickets');
const list2017 = ["AFC Cleveland", "Dayton Dynamo", "Erie Commodores FC", "FC Buffalo", "Fort Pitt Regiment", "Rochester Lancers", "Syracuse FC", "AFC Ann Arbor", "Detroit City FC", "FC Indiana", "Grand Rapids FC", "Kalamazoo FC", "Lansing United", "Michigan Stars FC", "MIlwaukee Torrent", "Dakota Fusion FC", "Duluth FC", "LC Aris FC", "Med City FC", "Minneapolis City SC", "Minnesota TwinStars FC", "Sioux Falls Thunder FC", "VSLT FC", "Brooklyn Italians", "Elm City Express", "Greater Lowell NPSL FC", "New York Cosmos B", "Seacoast United Phantoms", "TSF FC", "Boston City FC", "Hartford City FC", "Kingston Stockade FC", "New York Athletic Club", "Rhode Island Reds FC", "Seacoast United Mariners", "Buxmont Torch", "Clarkstown SC Eagles", "Electric City Shock", "Greater Binghamton FC Thunder", "Hershey FC", "Junior Lone Star FC", "New Jersey Copa FC", "West Chester United SC", "FC Frederick", "Fredericksburg FC", "Legacy 76", "Virginia Beach City FC", "Dallas City FC", "Demize NPSL", "FC Wichita", "Little Rock Rangers", "Ozark FC", "Tulsa Athletic", "Dutch Lions FC", "Fort Worth Vaqueros FC", "Houston Regals SCA", "Midland-Odessa FC", "Shreveport Rafters FC", "Tyler FC", "Asheville City SC", "Atlanta SIlverbacks FC", "Birmingham Hammers", "Chattanooga FC", "FC Carolina United", "Georgia Revolution FC", "Inter Nashville FC", "Knoxville Force", "Memphis City FC", "New Orleans Jesters", "Beaches FC", "Boca Raton FC", "Jacksonville Armada U-23", "Kraze United", "Miami Fusion FC", "Miami United FC", "Naples United FC", "CD Aguiluchos USA", "East Bay FC Stompers", "Napa Valley 1839 FC", "Sacramento Gold FC", "Sonoma County Sol FC", "FCM Portland", "Kitsap SC", "OSA FC", "PDX FC", "Pierce County FC", "Spokane SC Shadow", "Albion SC", "City of Angels FC", "FC Arizona", "Orange County FC", "Oxnard Guerreros FC", "Riverside Coras", "SoCal SC", "Sports Club Corinthians USA", "Temecula FC"];
@SeanMcP
Copy link
Author

SeanMcP commented May 12, 2018

NSPL Expansion Tracker

In addition to developing, I (on occasion) write about lower-division soccer in the United States. Most of work revolves around the NPSL, a defacto fourth-division amateur league. There is a lot of turnover from year to year, so in the offseason I spend a great deal of time tracking the expansions and departures.

Now that I know how to use computers to do my work for me, I have written some quick scripts to grab the information I need from the NPSL's team directory.

How To

Open up the console in your browser with ctrl + shift + i and paste the script.

Comparing

I created a pen to compare arrays: Compare and illustrate differences between two arrays. Use this to help track expansions and departures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment