Implement: libowski-bot-fix-vikes-tv.md - #4
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-generated from vault spec
notes/libowski-bot-fix-vikes-tv.md.The view-vikes-tv slash command was recently updated to also extract and display TV
network info per game. After that change, the command now returns "No Vikings games
found on the schedule" — it finds zero games at all. Before this change, the command
correctly found and displayed the next several upcoming games (just without TV info).
Look at the current implementation in src/commands/view-vikes-tv.js. The recent change
refactored the parsing to iterate over div.nfl-o-matchup-cards elements to correlate
game data with broadcast info — this refactor likely broke the game-matching logic
itself, not just the TV extraction. Fix the command so it correctly finds and displays
upcoming games again, with TV network info included where available (fall back to "TBD"
if not found, as before).
Expanded Spec
Problem
The
/view-vikes-tvslash command, after a recent refactor to include TV network information, now fails to find any Vikings games on the schedule, returning "No Vikings games found on the schedule." Previously, it correctly identified and displayed upcoming games. The issue is likely in the updated Cheerio parsing logic withinsrc/commands/view-vikes-tv.js, specifically howdiv.nfl-o-matchup-cardselements and their nestedscript[type="application/ld+json"]data are identified and processed. The current parsing results ingames.lengthbeing zero. Additionally, theEmbedBuildersection for formatting game details is incomplete.Acceptance Criteria
/view-vikes-tvcommand executes successfully and replies to the user.https://www.vikings.com/schedule/to identify upcoming Minnesota Vikings games.Notes for implementer
https://www.vikings.com/schedule/in a browser's developer tools. Look fordiv.nfl-o-matchup-cardsand the presence/structure ofscript[type="application/ld+json"]within them, as well as the.nfl-o-matchup-cards__media-tv--networksclass for TV info. The page structure might have changed, rendering the current Cheerio selectors invalid or incomplete.games.lengthbeing 0. Focus on why$('div.nfl-o-matchup-cards')might not be selecting elements, or why the subsequentjsonextraction and@typecheck (if ($jsonScript.length === 0) return;orif (json["@type"] === "SportsEvent")) might be failing..nfl-o-matchup-cards__media-tv--networksstill correctly targets the TV network text. Fallback to "TBD" if it's missing.src/commands/view-vikes-tv.jsfile has an incompleteEmbedBuildersection. You'll need to complete thedateStrformatting and addembed.addFields(...)to correctly display the game details (dateStr, opponent, time, TV info) for eachupcomingGame. Consider usingIntl.DateTimeFormatfor robust date/time formatting.