The unpac monorepo manager self-hosting as a monorepo using unpac

Remove ocamltweets.ml, search api now requires auth. gfy twitter.

-98
-1
vendor/opam/jsonm/README
··· 51 51 The resulting binaries are in `_build/test` : 52 52 53 53 - `test.native` tests the library, nothing should fail. 54 - - `ocamltweets.native` gives you the latest tweets about OCaml. 55 54 - `jsontrip.native` among other things, reads JSON on `stdin` and rewrites it 56 55 on `stdout`. Invoke with `-help` for more information.
-6
vendor/opam/jsonm/_oasis
··· 34 34 CompiledObject: Best 35 35 BuildDepends: jsonm, unix 36 36 37 - Executable ocamltweets 38 - Path: test 39 - MainIs: ocamltweets.ml 40 - CompiledObject: Best 41 - BuildDepends: jsonm, unix 42 - 43 37 Executable test 44 38 Path: test 45 39 MainIs: test.ml
-1
vendor/opam/jsonm/_tags
··· 2 2 <src> : include 3 3 <test> : include 4 4 <test/jsontrip.{byte,native}> : package(unix), package(uutf) 5 - <test/ocamltweets.{byte,native}> : package(unix), package(uutf) 6 5 <test/examples.{byte,native}> : package(unix), package(uutf) 7 6 <test/test.{byte,native}> : package(uutf) 8 7 <test/jtree.{byte,native}> : package(uutf)
-89
vendor/opam/jsonm/test/ocamltweets.ml
··· 1 - (* This code is in the public domain. *) 2 - 3 - let str = Format.sprintf 4 - let pp = Format.fprintf 5 - let pp_text ppf s = (* hints whitespace, this should really be in Format. *) 6 - let left = ref 0 and right = ref 0 and len = String.length s in 7 - let flush () = 8 - Format.pp_print_string ppf (String.sub s !left (!right - !left)); 9 - incr right; left := !right; 10 - in 11 - while (!right <> len) do 12 - if s.[!right] = '\n' then (flush (); Format.pp_force_newline ppf ()) else 13 - if s.[!right] = ' ' then (flush (); Format.pp_print_space ppf ()) else 14 - incr right; 15 - done; 16 - if !left <> len then flush () 17 - 18 - let http_get uri = Unix.open_process_in (str "curl -L -f -s \"%s\"" uri) 19 - 20 - (* Tweets *) 21 - 22 - type tweet = 23 - { id : string; 24 - date : string; 25 - userid : string; 26 - username : string; 27 - text : string; } 28 - 29 - let tweet_link t = str "http://twitter.com/%s/status/%s" t.userid t.id 30 - let tweet_search q max = (* [q] should be URI encoded... *) 31 - str "http://search.twitter.com/search.json?q=%s&rpp=%d" q max 32 - 33 - let pp_tweet ppf t = pp ppf "@\n* @[%s - %s@]@\n @[%s@]@\n@\n @[%a@]@\n@." 34 - t.username (tweet_link t) t.date pp_text t.text 35 - 36 - (* N.B. The parsing code assumes members are given in order. Theoretically 37 - there's no order in JSON members. *) 38 - 39 - let fold_tweets f acc src = 40 - let ret a = `Ok a in 41 - let bind v f = match v with `Error -> `Error | `End -> `End | `Ok v -> f v in 42 - let rec mem n d = match Jsonm.decode d with 43 - | `Lexeme (`Name n') when n = n' -> 44 - begin match Jsonm.decode d with 45 - | `Lexeme (`String s) -> ret s | _ -> `Error 46 - end 47 - | `End -> `End 48 - | _ -> mem n d 49 - in 50 - let parse_tweet d = 51 - bind (mem "created_at" d) (fun date -> 52 - bind (mem "from_user_id_str" d) (fun userid -> 53 - bind (mem "from_user_name" d) (fun username -> 54 - bind (mem "id_str" d) (fun id -> 55 - bind (mem "text" d) (fun text -> 56 - ret { id; date; userid; username; text }))))) 57 - in 58 - let rec loop f acc d = match parse_tweet d with 59 - | `Ok t -> loop f (f acc t) d 60 - | `End -> acc 61 - | `Error -> loop f acc d 62 - in 63 - loop f acc (Jsonm.decoder src) 64 - 65 - let ocaml_tweets max = 66 - let pp_tweet () t = pp_tweet Format.std_formatter t in 67 - let ic = http_get (tweet_search "OCaml" max) in 68 - fold_tweets pp_tweet () (`Channel ic); 69 - close_in ic 70 - 71 - let main () = 72 - let exec = Filename.basename Sys.executable_name in 73 - let usage = str 74 - "Usage: %s [OPTION]...\n\ 75 - \ Print the latest tweets about OCaml on stdout.\n\ 76 - Options:" exec 77 - in 78 - let max = ref 50 in 79 - let pmode = ref false in 80 - let options = [ 81 - "-max", Arg.Set_int max, "<int> Maximal number of tweets"; 82 - "-p", Arg.Set pmode, " Procrastination mode"; ] 83 - in 84 - let anon _ = raise (Arg.Bad "illegal argument") in 85 - Arg.parse (Arg.align options) anon usage; 86 - if !pmode then pp Format.std_formatter "Work harder !@." else 87 - ocaml_tweets !max 88 - 89 - let () = main ()
-1
vendor/opam/jsonm/test/tests.itarget
··· 1 1 examples.native 2 2 test.native 3 3 jtree.native 4 - ocamltweets.native 5 4 jsontrip.native