hurriyet-0.1.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 :: Client -> Id -> IO (Either String Page) Source #

Get a single page

getPages :: Client -> IO (Either String [Page]) Source #

Get all pages

getNewsPhotoGallery :: Client -> Id -> IO (Either String NewsPhotoGallery) Source #

Get a single news photo gallery

getNewsPhotoGalleries :: Client -> IO (Either String [NewsPhotoGallery]) Source #

Get all news photo galleries

getColumn :: Client -> Id -> IO (Either String Column) Source #

Get a single column

getColumns :: Client -> IO (Either String [Column]) Source #

Get all columns

getPath :: Client -> Id -> IO (Either String Path) Source #

Get a single path

getPaths :: Client -> IO (Either String [Path]) Source #

Get all paths

getWriter :: Client -> Id -> IO (Either String Writer) Source #

Get a single writer

getWriters :: Client -> IO (Either String [Writer]) Source #

Get all writers

getArticle :: Client -> Id -> IO (Either String Article) Source #

Get single article

getArticles :: Client -> IO (Either String [Article]) Source #

Get all articles