hurriyet-0.2.0.0: Haskell bindings for Hurriyet API

Copyright(c) Yiğit Özkavcı 2017
LicenseWTFPL
Maintaineryigitozkavci8@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Hurriyet

Description

This module controls all the data flow and client interface required to interact with the library.

Synopsis

Documentation

type Id = String Source #

Type synonym for Id which will be used for endpoints

type ApiKey = String Source #

Type synonym for api key

newtype Client Source #

Client will be used and passed through every API call

Constructors

Client 

Fields

getClient :: String -> Client Source #

This is how you construct the client. Takes apiKey as an argument

data Resource Source #

Each of these resources represent services. These are used for passing service-spesific data such as endpoint string

Instances

Show Resource Source #

Each resource represents an endpoint string

data Operation Source #

For now, Hurriyet API only consists of 2 operations. As we have more, new operations will be added into here

Constructors

List Resource 
Show Resource Id 

baseUrl :: String Source #

Base url of the Hurriyet API

getUrl :: Operation -> String Source #

This method constructs url given the operation. Operation already contains enough data to construct the url

fetchResource :: Client -> Operation -> IO ByteString Source #

Given a client and a operation, this method can conquer the world. But prefers not to and returns a bytestring representing json string of the response body

getPage :: Id -> ServiceResponse Page Source #

Get a single page

getNewsPhotoGallery :: Id -> ServiceResponse NewsPhotoGallery Source #

Get a single news photo gallery

getColumn :: Id -> ServiceResponse Column Source #

Get a single column

getPath :: Id -> ServiceResponse Path Source #

Get a single path

getWriter :: Id -> ServiceResponse Writer Source #

Get a single writer

getArticle :: Id -> ServiceResponse Article Source #

Get single article