Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sport_fixture default behavior should not need to add leagues individually #178

Open
zalazarcarlos opened this issue Mar 23, 2021 · 2 comments

Comments

@zalazarcarlos
Copy link

tuxi/tuxi

Lines 616 to 625 in 75572b0

# Shows last or next fixture of a sports team ( eg. Chelsea next game ) //original snippet credit @ismayilkarimli
a_sport_fixture() {
sport_fixture="$(echo "$google_html" | pup 'span[jscontroller="f9W5M"] text{}' | recode html..ISO-8859-1)"
if [ -n "$sport_fixture" ]; then
case "$sport_fixture" in
"Premier League" | "EFL "* | "FA "* | "MLS" | "Canadian Premier League" | "USL "* | "UEFA "* | "Ligue "* | "Coupe de France" | "Trophée des Champions" | *"Bundesliga" | "DFB-Pokal" | "Serie "* | "Coppa Italia" | "Supercoppa Italiana" | "Eredivisie" | "Eerste Divisie" | "Tweede Divisie" | "KNVB "* | "Johan Cruijff"* | "Scottish Premiership" | "Scottish Championship" | "Scottish Cup" | "Scottish League Cup" | "La Liga" | "Segunda División" | "Tercera División" | "Copa del Rey" | "Supercopa de España" | "Copa Federación" | "Allsvenskan" | "Superettan" | "Svenska Cupen" | "Swiss Super League" | "Swiss Challenge League" | "Schweizer Cup" | "Uhrencup")
sf_use_new=true
;;
*) sf_use_new=false ;;
esac

I tried to find "Independiente next match" (team from Argentine Primera Division)
and "lakers next match"
didn't work
After adding NBA and Argentin* in this list it works

But adding every single league seems wrong
Could someone let this new function $sf_use_new (case) as default behavior

Maybe using this as another "search" and keeping the old one if some search need it.

priority="
........
lyrics_int # Lyrics ( eg: gecgecgec lyrics )
........
sport_fixture # Shows last or next fixture of a sports team ( eg. Chelsea next game ) //new function as default, no case
sport_fixture_old # keep old function until deprecated
lyrics_us # Lyrics for US users, above does not work for US
"

@PureArtistry
Copy link
Collaborator

that could be an option if it works for more stuff than it doesn't.

the problem with it was I only know football and could only test that, somebody else tested it with american football and the format was messed up.

I decided to lock it behind what I knew worked and hoped people would give me more html for other sports so I could update it to make it work for theirs

Thanks for the info that it works fine for basketball though

@zalazarcarlos
Copy link
Author

zalazarcarlos commented Mar 23, 2021

The output it's not perfect, but it works, because you can get day and time for next match, both teams names and league/cup.
``
~/ $ tuxi independiente next match [11:08:14]

Independiente Sun, Mar 28, 21:00
Boca Juniors First phase · Group B · Matchday 7 of 13
VS Argentine Primera División

~/ $ tuxi lakers next match [11:08:24]

New Orleans Pelicans today, 20:30
VS Los Angeles Lakers
(18 - 24) NBA

~/ $ tuxi man u next game [11:08:54]

Man United Sun, Apr 4, 15:30
Brighton
VS Premier League
``

feh_002566_000001_snap
feh_002631_000001_snap
feh_002647_000001_snap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants