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 *)
|
||||
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 *)
|
||||
|
|
Loading…
Reference in a new issue