GithubHelp home page GithubHelp logo

latkins / hackernews Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dmjio/hackernews

0.0 2.0 0.0 59 KB

:newspaper: Hacker News API for Haskell

License: MIT License

Haskell 94.34% Nix 2.09% Shell 3.57%

hackernews's Introduction

hackernews

Hackage Hackage Dependencies Haskell Programming Language BSD3 License Build Status

Hacker News API for Haskell

###Documentation https://github.com/HackerNews/API

Now it supports GHCJS and can be used in the browser! Just install it using:

cabal install --ghcjs --flags=ghcjs

###Tests

cabal configure && cabal test
Hacker News API Tests
  - Retrieves a Story
  - Retrieves a Comment
  - Retrieves a User
  - Retrieves a Poll
  - Retrieves a Pollopt
  - Retrieves Top Stories
  - Retrieves Max Item
  - Retrieves Updates

Finished in 0.0019 seconds
8 examples, 0 failures

###Usage

module Example where

import           Control.Monad  (liftM3)
import           Web.HackerNews (UserId (..), getUser, hackerNews)

main :: IO ()
main = print =<< hackerNews (liftM3 (,,) one two three)
  where
    one   = getUser (UserId "dmjio")
    two   = getUser (UserId "dmj")
    three = getUser (UserId "abs")
(Just (User { userAbout = Nothing
            , userCreated = 2013-08-06 16:49:23 UTC
            , userDelay = 0
            , userId = UserId "dmjio"
            , userKarma = 6
            , userSubmitted = [8433827,8429256,8429161,8429069,8374809,8341570,7919268,7825469,7350544,7327291,6495994,6352317,6168527,6168524,6167639]})
      , 
Just (User { userAbout = Nothing
           , userCreated = 2007-04-11 05:57:35 UTC
           , userDelay = 0
           , userId = UserId "dmj"
           , userKarma = 1
           , userSubmitted = [11737]
           }),
Nothing)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.