New script tennis.py: live tennis scores and ATP/WTA rankings on demand - #614
Merged
Merged
Conversation
Member
|
Thanks, script added! |
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.
Disclosure: I work on the Live Tennis API, the service this script talks to. I am submitting it because the catalogue has no tennis or live-scores script of any kind, but please weigh it knowing the author has a commercial interest in the API. It needs a key from that service to do anything; free keys require no card. Happy to adjust or withdraw if a vendor-authored script is not something you want to carry. AI tooling was used while writing it; I understand every line and have tested the logic, as described below.
Script info
hook_url)Description
Live tennis scores and rankings on demand, printed on the buffer where you ran the command.
/tennis live— every match in play, one line each: match id, surnames, set scores, the points of the game in progress, then the tournament.*follows the player serving;BPmeans the receiver is one point from a break./tennis match <id>— one match, with both players' country and ranking and the match state./tennis atp [count]//tennis wta [count]— singles rankings with the weekly movement.Example line:
Notes on the design:
hook_urlwith a callback; the client is never held up.plugins.var.python.tennis.api_keyand is read throughstring_eval_expressionat call time, so/secureworks:/set plugins.var.python.tennis.api_key "${sec.data.livetennisapi}"./tennis atpand/tennis wtaanswer "this data is not included in your plan" on a free key./help tennissays so.liveandmatchare the free-tier commands.Checklist (new script)
New script name.py: short description…hook_urlis used for any blocking callmake checkandreuse lintare both green locally (381/381 files with licence information).One caveat for your review: I do not have WeeChat installed on the machine I wrote this on, so while the logic is covered by a stubbed-API harness (break-point derivation, score formatting, response and error handling, request construction, the version guard), I have not been able to
/script loadit in a real client. I would be grateful if a reviewer exercised that path.