From a8571e359737b17b25555cd4d535a6a4154d59e5 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Fri, 12 Dec 2014 23:25:41 +0100 Subject: [PATCH] Put titles in brackets. --- ocaml/evaluate.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml/evaluate.ml b/ocaml/evaluate.ml index 3a100df..0b2e34c 100644 --- a/ocaml/evaluate.ml +++ b/ocaml/evaluate.ml @@ -25,5 +25,8 @@ let remove_spaces str = let evaluate str = match str with | str when is_url str -> - SimpleHttp.get_http_title (SimpleHttp.get_body str) |> remove_spaces + let title = SimpleHttp.get_http_title (SimpleHttp.get_body str) |> remove_spaces in + match title with + | Some t -> Some ("[ " ^ t ^ " ]") + | None -> None | _ -> None