mediawiki-0.2: Interfacing with the MediaWiki APISource codeContentsIndex
MediaWiki.API
Portabilityportable
Stabilityprovisional
MaintainerSigbjorn Finne <sof@forkIO.com>
Description
A Haskell MediaWiki API binding.
Synopsis
webGet :: URLString -> Request -> IO String
webPost :: Maybe User -> URLString -> String -> Request -> IO ([(String, String)], String)
webPostXml :: (String -> Either (String, [String]) a) -> Maybe User -> URLString -> String -> Request -> IO (Maybe a)
webGetXml :: (String -> Either (String, [String]) a) -> URLString -> Request -> IO (Maybe a)
queryPage :: PageName -> QueryRequest
mkQueryAction :: APIRequest a => QueryRequest -> a -> Action
loginWiki :: URLString -> String -> String -> IO (Maybe LoginResponse)
queryInfo :: URLString -> PageName -> IO String
querySiteIWInfo :: URLString -> IO (Maybe SiteInfoResponse)
queryLangPage :: URLString -> PageName -> Maybe String -> IO String
parseError :: String -> Either (String, [String]) MediaWikiError
xmlError :: Element -> Maybe MediaWikiError
data MediaWikiError = MediaWikiError {
mwErrorCode :: String
mwErrorInfo :: String
}
mwError :: MediaWikiError
data SomeMWException = forall e . Exception e => SomeMWException e
mwToException :: Exception e => e -> SomeException
mwFromException :: Exception e => SomeException -> Maybe e
handleMW :: (MediaWikiError -> IO a) -> IO a -> IO a
tryMW :: IO a -> IO (Either MediaWikiError a)
throwMWError :: MediaWikiError -> IO a
catchMW :: IO a -> (MediaWikiError -> IO a) -> IO a
type URLString = String
Documentation
webGet :: URLString -> Request -> IO StringSource
webGet url req issues a GET to a MediaWiki server, appending api.php? followed by the request req to the URL base url.
webPost :: Maybe User -> URLString -> String -> Request -> IO ([(String, String)], String)Source
webGet mbUser url req issues a POST to a MediaWiki server, appending api.php? followed by the request req to the URL base url.
webPostXml :: (String -> Either (String, [String]) a) -> Maybe User -> URLString -> String -> Request -> IO (Maybe a)Source
webGetXml :: (String -> Either (String, [String]) a) -> URLString -> Request -> IO (Maybe a)Source
queryPage :: PageName -> QueryRequestSource
mkQueryAction :: APIRequest a => QueryRequest -> a -> ActionSource
loginWiki :: URLString -> String -> String -> IO (Maybe LoginResponse)Source
queryInfo :: URLString -> PageName -> IO StringSource
querySiteIWInfo :: URLString -> IO (Maybe SiteInfoResponse)Source
queryLangPage :: URLString -> PageName -> Maybe String -> IO StringSource
parseError :: String -> Either (String, [String]) MediaWikiErrorSource
xmlError :: Element -> Maybe MediaWikiErrorSource
data MediaWikiError Source
Constructors
MediaWikiError
mwErrorCode :: String
mwErrorInfo :: String
show/hide Instances
mwError :: MediaWikiErrorSource
data SomeMWException Source
Constructors
forall e . Exception e => SomeMWException e
show/hide Instances
mwToException :: Exception e => e -> SomeExceptionSource
mwFromException :: Exception e => SomeException -> Maybe eSource
handleMW :: (MediaWikiError -> IO a) -> IO a -> IO aSource
tryMW :: IO a -> IO (Either MediaWikiError a)Source
throwMWError :: MediaWikiError -> IO aSource
catchMW :: IO a -> (MediaWikiError -> IO a) -> IO aSource
type URLString = StringSource
Produced by Haddock version 2.7.2