Skip to content

Instantly share code, notes, and snippets.

@minac
Last active May 27, 2025 18:18
Show Gist options
  • Save minac/8922d795eb61d3c7ff418ef0cfd8c196 to your computer and use it in GitHub Desktop.
Save minac/8922d795eb61d3c7ff418ef0cfd8c196 to your computer and use it in GitHub Desktop.
NBA playoffs
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