Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 39 lines (29 sloc) 1.388 kb
8a95315 @dsheets Reorganization of API modules, protection of interfaces
authored
1 (*
2 ocaml-facebook - Facebook Platform client API in OCaml
3
4 Copyright (C) <2010> David Sheets <sheets@alum.mit.edu>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation, version 2.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 USA
19 *)
20
21 open Lwt
22 open Api
23 module J = Json_type.Browse
24
25 let call user = Namespace.call_method "users" user
26
27 let get_info user users fields = call user "getInfo"
28 [("uids", `List (List.map (fun u -> `B u.uid) users));
29 ("fields", `List fields)]
30
31 let get_standard_info user users fields = call user "getStandardInfo"
32 [("uids", `List (List.map (fun u -> `B u.uid) users));
33 ("fields", `List fields)]
34
35 (* TODO: Really? Mutate the world for a boolean API call?! *)
36 let is_app_user user =
37 lwt b = (call user "isAppUser" [("uid", `B user.uid)]) >|= J.bool
38 in save_user {user with added=b}; return b
Something went wrong with that request. Please try again.