doc
This commit is contained in:
parent
cd650991bc
commit
88456e17ca
3 changed files with 11 additions and 12 deletions
|
|
@ -146,7 +146,8 @@ let f () =
|
|||
***\n"
|
||||
in
|
||||
let md =
|
||||
sprintf "%s\n\n```text\n%s\n\nUTC-3/[local time]\n```\n\n%s" header schedules footer
|
||||
sprintf "%s\n\n```text\n%s\n\nUTC-3/[local time]\n```\n\n%s" header
|
||||
schedules footer
|
||||
in
|
||||
(* print_endline md *)
|
||||
Rentry.update_page md
|
||||
|
|
|
|||
14
lib/lib.ml
14
lib/lib.ml
|
|
@ -139,13 +139,14 @@ module Tournament = struct
|
|||
t.start_timestamp |> float_of_int |> Unix.gmtime
|
||||
in
|
||||
sprintf "%02d:%02d/%02d:%02d" ts1.tm_hour ts1.tm_min
|
||||
(mmod (ts2.tm_hour + off) 24) ts2.tm_min)
|
||||
(mmod (ts2.tm_hour + off) 24)
|
||||
ts2.tm_min)
|
||||
in
|
||||
sprintf "%s | %s x %s" timestamp x.home_team.name x.away_team.name)
|
||||
|> String.concat "\n"
|
||||
in
|
||||
if m = "" then ""
|
||||
else
|
||||
if m = "" then ""
|
||||
else
|
||||
match tournament.context.timezone_offset with
|
||||
| None -> sprintf ">%s\n%s" tournament.context.name m
|
||||
| Some off -> sprintf ">%s (UTC%d)\n%s" tournament.context.name off m
|
||||
|
|
@ -153,6 +154,7 @@ end
|
|||
|
||||
let ( let* ) = Lwt.bind
|
||||
|
||||
(* TODO: handle "resolution fai led: name resolution failed" *)
|
||||
let get url : string =
|
||||
let http_get url =
|
||||
Printf.printf "\r%-90s" url;
|
||||
|
|
@ -191,11 +193,7 @@ let matches_of_api_events (e : api_events) =
|
|||
injuryTime2 = y;
|
||||
currentPeriodStartTimestamp = _;
|
||||
} ->
|
||||
SecondHalf
|
||||
{
|
||||
injury_time1 = x;
|
||||
injury_time2 = y;
|
||||
}
|
||||
SecondHalf { injury_time1 = x; injury_time2 = y }
|
||||
| {
|
||||
injuryTime1 = None;
|
||||
injuryTime2 = Some y;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ let update_page content =
|
|||
Cohttp_lwt.Body.of_form
|
||||
[
|
||||
("csrfmiddlewaretoken", [ value ]);
|
||||
("edit_code", [ "foo perro bar caca" ]);
|
||||
("metadata", ["ACCESS_RECOMMENDED_THEME=dark"]);
|
||||
("edit_code", [ "foo perro bar caca" ]); (* TODO: use environmental variables *)
|
||||
("metadata", [ "ACCESS_RECOMMENDED_THEME=dark" ]);
|
||||
("text", [ content ]);
|
||||
]
|
||||
in
|
||||
|
|
@ -31,7 +31,7 @@ let update_page content =
|
|||
let h0 = init () in
|
||||
let h1 = add h0 "Referer" "https://rentry.org" in
|
||||
let h2 = add h1 "Content-Type" "application/x-www-form-urlencoded" in
|
||||
let h3 = add h2 "User-Agent" "copabot/v0.1.0" in
|
||||
let h3 = add h2 "User-Agent" "copabot/0.1.0" in
|
||||
let hname, hvalue =
|
||||
cookies
|
||||
|> List.map (fun (x : string * Cookie.Set_cookie_hdr.t) ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue