A small wrapper-library for the VK API (version 5.199). It's not complete, but you can extend it yourself. Builds on the Cohttp and Lwt abstractions in an implementation-independent way.
Installation of development version.
$ opam pin vkashka.dev https://github.com/dx3mod/vkashka.git
Example of use with the cohttp-lwt-unix backend:
open Lwt.Syntax
let () =
Lwt_main.run @@
let token = Vkashka.access_token "YOUR_TOKEN" in
let module Vk_api = Vkashka.Make (Cohttp_lwt_unix.Client) ((val token)) in
let* user = Vk_api.Users.(get ~user_ids:[ "username" ] () |> first_exn) in
Lwt_fmt.printf "User : %a" Vkashka.User.pp user
See also the examples/
directory for more references.
Lookup documentation using the odig
:
odig doc vkashka
Tutorial in Russian on ocamlportal.ru
- repostbot — real-world example
- VK API official documentation
- User
- Basic
- Optional fields A-I
- Optional fields L-R (70%)
- Basic Wall Record
- Users
- get
- Wall
- get (partial)
- getById (partial)