diff --git a/ocaml/build.sh b/ocaml/build.sh new file mode 100755 index 0000000..f0d5b41 --- /dev/null +++ b/ocaml/build.sh @@ -0,0 +1 @@ +ocamlfind ocamlc -package netclient str.cma main.ml -o cheesebot diff --git a/ocaml/main.ml b/ocaml/main.ml index 9694831..b8055e8 100644 --- a/ocaml/main.ml +++ b/ocaml/main.ml @@ -1,8 +1,10 @@ +open Http_client +open Str + (* Regexp required here *) let is_youtube_url url = - match url with - | "http://www.youtube.com/" -> true - | _ -> false;; + let regexp = Str.regexp "http://www.youtube.com/.+" in + Str.string_match regexp url 0;; (* Maybe have a list of functions and * iter on all the items in the list *)