Use regexp to check if youtube url.

- Add basic build command.
master
Fabien Freling 2013-12-08 17:07:53 +01:00
parent 642c6aa94a
commit a3488cb554
2 changed files with 6 additions and 3 deletions

1
ocaml/build.sh Executable file
View File

@ -0,0 +1 @@
ocamlfind ocamlc -package netclient str.cma main.ml -o cheesebot

View File

@ -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 *)