Use regexp to check if youtube url.
- Add basic build command.
This commit is contained in:
parent
642c6aa94a
commit
a3488cb554
1
ocaml/build.sh
Executable file
1
ocaml/build.sh
Executable file
|
@ -0,0 +1 @@
|
||||||
|
ocamlfind ocamlc -package netclient str.cma main.ml -o cheesebot
|
|
@ -1,8 +1,10 @@
|
||||||
|
open Http_client
|
||||||
|
open Str
|
||||||
|
|
||||||
(* Regexp required here *)
|
(* Regexp required here *)
|
||||||
let is_youtube_url url =
|
let is_youtube_url url =
|
||||||
match url with
|
let regexp = Str.regexp "http://www.youtube.com/.+" in
|
||||||
| "http://www.youtube.com/" -> true
|
Str.string_match regexp url 0;;
|
||||||
| _ -> false;;
|
|
||||||
|
|
||||||
(* Maybe have a list of functions and
|
(* Maybe have a list of functions and
|
||||||
* iter on all the items in the list *)
|
* iter on all the items in the list *)
|
||||||
|
|
Loading…
Reference in a new issue