VKHS-1.9: Provides access to Vkontakte social network via public API

Safe HaskellNone
LanguageHaskell98

Web.VKHS.API.Simple

Contents

Description

This module contains definitions of VK various API bindings. I tried to keep it as simple as possible. More, the user is expected to copy any function from this module into their runhaskell script and customize as required.

Runhaskell script may looks like the following: @ #!usrbin/env runhaskell {--} {--}

import Web.VKHS import Web.VKHS.Imports

main :: IO () main = runVK_ defaultOptions $ do Sized cnt gs <- groupSearch "Котики" forM_ gs $ grGroupRecord{..} -> do liftIO $ tputStrLn gr_name liftIO $ tputStrLn "--------------" Sized wc ws <- getGroupWall gr forM_ ws $ WallRecord{..} -> do liftIO $ tputStrLn wr_text liftIO $ tputStrLn "--------------"

See more scripts under .apprunhaskell folder

Synopsis

Documentation

ver :: Text Source #

We are using API v5.44 by default

apiSimpleF :: (MonadAPI m x s, FromJSON b) => MethodName -> [(String, Text)] -> (b -> Either String a) -> API m x a Source #

apiSimple :: (MonadAPI m x s, FromJSON a) => MethodName -> [(String, Text)] -> API m x a Source #

apiSimpleH :: (MonadAPI m x s, FromJSON a) => MethodName -> [(String, Text)] -> (ErrorRecord -> Maybe a) -> API m x a Source #

apiSimpleHM :: (MonadAPI m x s, FromJSON a) => MethodName -> [(String, Text)] -> (ErrorRecord -> API m x (Maybe a)) -> API m x a Source #

apiVer :: (MonadAPI m x s, FromJSON a) => String -> [(String, Text)] -> API m x a Source #

groupSearch :: MonadAPI m x s => Text -> API m x (Sized [GroupRecord]) Source #

This function demonstrates pure-functional error handling

getCities :: MonadAPI m x s => Country -> Maybe Text -> API m x (Sized [City]) Source #

getGroupWall :: forall m x s. MonadAPI m x s => GroupRecord -> API m x (Sized [WallRecord]) Source #

See [https:/vk.comdev/wall.get]

This function demonstrates monadic error handling

FIXME fix setUserPhoto, it is not actually working

FIXME move low-level upload code to API.Base