commit
This commit is contained in:
parent
3e6abd1ea1
commit
bb4cf6a9c6
6 changed files with 14585 additions and 0 deletions
1
.ocamlinit
Normal file
1
.ocamlinit
Normal file
|
|
@ -0,0 +1 @@
|
|||
open Lwt.Infix
|
||||
1
Dockerfile
Normal file
1
Dockerfile
Normal file
|
|
@ -0,0 +1 @@
|
|||
FROM ocaml/opam:debian
|
||||
6
README.md
Normal file
6
README.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
# TODO
|
||||
|
||||
- [ ] (2025-07-16) Lista de eventos com todos os gols por timestamp do dia.
|
||||
- [ ] (2025-07-16) Tabelas de classificação.
|
||||
- [ ] (2025-07-16) Atualização em tempo real.
|
||||
24
changelog.txt
Normal file
24
changelog.txt
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
##### changelog:
|
||||
2024-06-14 - rentry page initial release.
|
||||
2024-06-16 - included ecuador as a conmebol country.
|
||||
- fix formatting issues when there are no matches or all matches are concluded at a day.
|
||||
2024-06-17 - added copa america.
|
||||
2024-06-19 - added stats.
|
||||
- added flag frequency counter.
|
||||
2024-06-20 - tracking of multiple threads for stats.
|
||||
- added posts per hour counter.
|
||||
2024-06-21 - whitelist concacaf countries in copa america.
|
||||
2024-08-?? - remove stats.
|
||||
2025-01-06 - temporary script sunset.
|
||||
2025-03-26 - update hardcoded queries. revives the script.
|
||||
- mitigate the views counter inflation with a third-party counter.
|
||||
2025-04-06 - reorder copa chile.
|
||||
2025-06-04 - second attempt at reviving the script.
|
||||
2025-06-07 - added copa colombia.
|
||||
2025-06-14 - added club world cup filtering foreign clubs.
|
||||
2025-06-27 - rewrite the script in ocaml.
|
||||
2025-07-04 - updated PRY1.
|
||||
2025-07-09 - added copa nordeste.
|
||||
2025-07-11 - updated ARG1 and COL1.
|
||||
2025-07-12 - use short team names.
|
||||
|
||||
46
lib/foobar.ml
Normal file
46
lib/foobar.ml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
type match' =
|
||||
string (* home team *) * int (* goal difference *) * string (* away team *)
|
||||
|
||||
let matches =
|
||||
[
|
||||
("foo", 1, "car");
|
||||
("foo", 0, "bar");
|
||||
("foo", 1, "far");
|
||||
("car", 1, "bar");
|
||||
("foo", ~-1, "bar");
|
||||
("tar", 1, "fir");
|
||||
("bar", 1, "qux");
|
||||
("jor", ~-1, "far");
|
||||
("xir", 1, "kar");
|
||||
("car", ~-1, "qux");
|
||||
("far", 1, "qux");
|
||||
("car", 1, "foo");
|
||||
]
|
||||
|
||||
let way a b =
|
||||
let rec aux (at : string) (visited : string list) (accum : match' list) =
|
||||
if at = b then [ List.rev accum ]
|
||||
else
|
||||
let matches =
|
||||
matches |> List.filter (function _, score, _ -> score <> 0)
|
||||
in
|
||||
let h =
|
||||
matches
|
||||
|> List.filter (function home, score, away ->
|
||||
score > 0 && home = at && not (List.exists (( = ) away) visited))
|
||||
|> List.map (function (_, _, away) as x ->
|
||||
aux away (at :: visited) (x :: accum))
|
||||
|> List.concat
|
||||
in
|
||||
let a =
|
||||
matches
|
||||
|> List.filter (function home, score, away ->
|
||||
score < 0 && away = at && not (List.exists (( = ) home) visited))
|
||||
|> List.map (function (home, _, _) as x ->
|
||||
aux home (at :: visited) (x :: accum))
|
||||
|> List.concat
|
||||
in
|
||||
a @ h
|
||||
in
|
||||
aux a [] []
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue