Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 848 Bytes

README.md

File metadata and controls

39 lines (27 loc) · 848 Bytes

Haskell bindings for VKontakte

Currently authentication, users, audio and video parts are fully implemented.

Please let me know if want other parts of API.

Code can be used in both, GHC and GHCJS.

Usage

-- Prepare our own state for application
data AppState = AppState [T.Text]

appState :: AppState
appState = AppState []

userName :: T.Text
userName = "myname@gmail.com"

userPass :: T.Text
userPass = "mypass"

appId :: Integer
appId = 1234567

appScope :: [AuthPermissions]
appScope = [Audio, Video]

vksettings :: VKSettings
vksettings = createSettings appId userName userPass (Just appScope)

execVKAPI appState vksettings $ do
uid <- liftState $ gets getUserId
-- get first 10 from my own audio records
toAPI $ D.def{A.getOwnerId = Just $ UserId uid
              , A.getCount = Just 10
        }