From 4431ffd4ea72a30003ae5ccde3e3d61bf64313eb Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 31 May 2020 22:31:33 -0400 Subject: We can now make requests --- bin/leda.ml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'bin') diff --git a/bin/leda.ml b/bin/leda.ml index 07fe43c..40074ff 100644 --- a/bin/leda.ml +++ b/bin/leda.ml @@ -1,20 +1,11 @@ module M = Gemini.MimeTextGemini.MimeTextGemini -let test_gemini = "=> /blah mylink\r\n\ - => /blah\r\n\ - ```\r\n\ - preformatted 1\r\n\ - preformatted 2\r\n\ - ``` ending preformatted text\r\n\ - some text\r\n\ - more text\r\n\ - \r\n\ - * unordered list\r\n" - -let _ = print_endline test_gemini - -let _ = print_endline "\n\n...gets parsed as...\n\n" - let test_parse s = M.gemini_to_canon_str (M.str_to_gemini s) -let main = print_endline (test_parse test_gemini) +module T = Gemini.MimeType.MimeType +module R = Gemini.Request.GeminiTransaction(T) + +let main = + match R.request "gemini://gemini.circumlunar.space/\r\n" with + | Some (_, _, s) -> print_endline s + | _ -> print_endline "oops" -- cgit v1.2.3