https://github.com/yigitozkavci/hurriyet-haskell
Haskell bindings for Hurriyet API
https://github.com/yigitozkavci/hurriyet-haskell
api api-client client-lib client-sdk haskell hurriyet
Last synced: 10 months ago
JSON representation
Haskell bindings for Hurriyet API
- Host: GitHub
- URL: https://github.com/yigitozkavci/hurriyet-haskell
- Owner: yigitozkavci
- License: mit
- Created: 2017-01-26T09:09:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-18T20:08:33.000Z (almost 9 years ago)
- Last Synced: 2025-07-18T19:26:53.032Z (11 months ago)
- Topics: api, api-client, client-lib, client-sdk, haskell, hurriyet
- Language: Haskell
- Size: 43 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# hurriyet-haskell
Haskell bindings for Hurriyet API - http://developers.hurriyet.com.tr/
# Getting Started
This section provides just enough material to get you started. For a more sophisticated
illustration of the library, visit https://hackage.haskell.org/package/hurriyet for documentation.
To get started, do the following steps:
- Install the package `$ cabal install hurriyet`
- Go and get your api key from http://developers.hurriyet.com.tr/ while the package is being installed
- And start using it! See below for examples
# Examples
## Get the list of articles
```haskell
import Hurriyet
import Hurriyet.Services
client :: Client
client = getClient ""
main = do
response <- withClient client getArticles
case response of
Left err -> print err
Right articles -> print articles
```
## Get the metadata of the first file of the first article
```haskell
import Hurriyet
import Hurriyet.Services
import Hurriyet.Services.Article
import Hurriyet.Services.File
client :: Client
client = getClient ""
main = do
response <- withClient client getArticles
case response of
Left err -> print err
Right (article:_) -> print . metadata . head $ files article
```
Note that in order to use any accessor method for any of the services, you should import the relative service. See [here](https://hackage.haskell.org/package/hurriyet) for more detailed information regarding services.
# Contributing
This library is currently maintained by me, and appreciate any contributions even if they just update the docs.
There are beginner-friendly issues in [here](https://github.com/yigitozkavci/hurriyet-haskell/issues), and I encourage you to see if you can contribute in any way.
# LICENSE
[MIT License](LICENSE)