Last active
May 27, 2025 18:18
-
-
Save minac/8922d795eb61d3c7ff418ef0cfd8c196 to your computer and use it in GitHub Desktop.
NBA playoffs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
name: "nbaScores", | |
displayName: "NBA Playoffs", | |
description: "Last 3 NBA playoff games and their scores", | |
async run() { | |
const res = await fetch("https://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard"); | |
const data = await res.json(); | |
const games = data.events.slice(-3).map(event => { | |
const teams = event.competitions[0].competitors.map(c => `${c.team.shortDisplayName}: ${c.score}`); | |
return `${event.name}\n${teams.join(" vs ")}`; | |
}); | |
return games.join("\n\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment