Skip to content

Implement: improve-view-vikes-tv.md - #3

Merged
emb417 merged 1 commit into
mainfrom
vault-spec/improve-view-vikes-tv
Aug 30, 2026
Merged

emb417 merged 1 commit into
mainfrom
vault-spec/improve-view-vikes-tv

Conversation

@emb417

@emb417 emb417 commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Auto-generated from vault spec notes/improve-view-vikes-tv.md.

Improve the view-vikes-tv command in the emb417/libowski-bot repository to include the TV station(s) for each game. Currently, the command displays the schedule, but users have to look up the TV station elsewhere. I want the command to automatically fetch and display this information so it's all in one place.


Expanded Spec

Problem

The view-vikes-tv command in src/commands/view-vikes-tv.js currently displays upcoming Minnesota Vikings games but lacks information about the TV station(s) broadcasting each game. Users must consult external sources to find this crucial detail, making the command less convenient than desired. The goal is to integrate TV station information directly into the command's output.

Acceptance Criteria

  1. TV Station Display: When /view-vikes-tv is executed, the output for each upcoming game must include the corresponding TV station(s).
  2. Integration into Embed: The TV station information must be presented clearly within the existing EmbedBuilder structure for each game, likely as part of the game's field description.
  3. Graceful Handling of Missing Data: If TV station information cannot be found for a particular game, the command should gracefully indicate this (e.g., by displaying "TV: TBD" or omitting the TV detail for that specific game) without crashing or displaying incorrect data.
  4. Existing Functionality Maintained: The command must continue to fetch and display upcoming games in chronological order, up to 10 games, using the vikings.com schedule data as its primary source for game dates and opponents.
  5. Performance: The addition of TV station lookup should not significantly degrade the command's response time beyond reasonable expectations for a network request.

Notes for implementer

  1. Data Source Analysis: The src/commands/view-vikes-tv.js command currently scrapes game data from https://www.vikings.com/schedule/ using Cheerio to parse script[type="application/ld+json"] tags. Investigate if the TV broadcast information is available within other HTML elements on this page or as part of the SportsEvent JSON objects being parsed. This would be the most straightforward approach.
  2. Alternative Data Source (if needed): If vikings.com does not readily provide TV station data, consider external APIs or scraping. The src/commands/view-blazers-tv.js command utilizes https://tvlistings.gracenote.com/api/sslgrid. While this specific Gracenote API call is tailored for the Portland Trail Blazers (e.g., prgsvcid=62792, postalCode=97232), it demonstrates a method for fetching TV listings. Adapting this approach for the Vikings would require identifying the correct prgsvcid and appropriate geographical parameters for the target broadcast region. This might be significantly more complex due to the API's specific parameters.
  3. Parsing and Integration: Once the TV station data source is identified, it needs to be fetched and correlated with the existing game objects. The forEach loop responsible for building the EmbedBuilder fields in chatInputRun will need modification to include this new information.
  4. Error Handling: Implement robust error handling for any new data fetching mechanisms, including network issues, API rate limits, or unexpected data formats, to ensure the command remains stable.
  5. User-Agent: Remember to include an appropriate User-Agent header for any new HTTP requests to avoid being blocked, as seen in the existing view-vikes-tv.js and view-blazers-tv.js commands.

@emb417 emb417 added the minor Minor-level semver bump label Aug 30, 2026
@emb417
emb417 merged commit 3445860 into main Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Minor-level semver bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant