A Clojure library for working with public VK API
(use 'clojure-vk.auth, 'clojure-vk.core)
; Getting url for authorization
(def auth-url
(get-auth-url
app-id
"https://oauth.vk.com/blank.html"
:display-page
{:scope (scope :offline),
:response-type "token"}))
; Getting user by id
(def durov (vk :users :get {:user-ids "durov"})) ;= {:id 1, :first-name "Павел", :last-name "Дуров"}
Currently the library can't authorize automatically, but it provides several functions that can help you
All requests are performed using clojure-vk/vk
function with signature [category method params]
.
For example, you need to call API method users.getFollowers. Category here is :users
, and the method is :get-followers
.
Note: you can either pass the method name in camelCase or kebab-case, the library will handle conversion for you. Also, every keyword in result gets converted to kebab-case (params
get converted vice versa)
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close