{"id":20537984,"url":"https://github.com/dmjio/hackernews","last_synced_at":"2025-05-09T13:31:12.335Z","repository":{"id":21676731,"uuid":"24997892","full_name":"dmjio/hackernews","owner":"dmjio","description":":newspaper: HackerNews API","archived":true,"fork":false,"pushed_at":"2024-12-14T01:19:05.000Z","size":108,"stargazers_count":40,"open_issues_count":4,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-25T00:35:20.235Z","etag":null,"topics":["ghcjs","hacker-news-api","haskell","http-client","servant"],"latest_commit_sha":null,"homepage":"http://hackage.haskell.org/package/hackernews","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmjio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-09T16:21:35.000Z","updated_at":"2024-12-14T02:18:42.000Z","dependencies_parsed_at":"2022-08-17T17:51:02.043Z","dependency_job_id":null,"html_url":"https://github.com/dmjio/hackernews","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmjio%2Fhackernews","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmjio%2Fhackernews/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmjio%2Fhackernews/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmjio%2Fhackernews/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmjio","download_url":"https://codeload.github.com/dmjio/hackernews/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253258188,"owners_count":21879607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ghcjs","hacker-news-api","haskell","http-client","servant"],"created_at":"2024-11-16T00:43:46.844Z","updated_at":"2025-05-09T13:31:12.039Z","avatar_url":"https://github.com/dmjio.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"hackernews\n==========\n![Hackage](https://img.shields.io/hackage/v/hackernews.svg)\n![Hackage Dependencies](https://img.shields.io/hackage-deps/v/hackernews.svg)\n![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-blue.svg)\n![MIT License](http://img.shields.io/badge/license-MIT-brightgreen.svg)\n[![Build Status](https://travis-ci.org/dmjio/hackernews.svg?branch=master)](https://travis-ci.org/dmjio/hackernews)\n\nHacker News API for Haskell\n\n### Documentation\n\u003chttps://github.com/HackerNews/API\u003e\n\nNow it supports GHCJS and can be used in the browser! Just install it using:\n```bash\ncabal install --ghcjs\n```\n\n### Tests\n```bash\ncabal configure \u0026\u0026 cabal test\n```\n\n```bash\nHackerNews API tests\n  should round trip Updates JSON\n  should round trip Item JSON\n  should round trip User JSON\n  should retrieve item\n  should retrieve user\n  should retrieve max item\n  should retrieve top stories\n  should retrieve new stories\n  should retrieve best stories\n  should retrieve ask stories\n  should retrieve show stories\n  should retrieve job stories\n  should retrieve updates\n\n  Finished in 1.2129 seconds\n  13 examples, 0 failures\n```\n\n### Usage\n```haskell\nmodule Main where\n\nimport Network.HTTP.Client\nimport Network.HTTP.Client.TLS\n\nimport Web.HackerNews\n\nmain :: IO ()\nmain = do\n mgr \u003c- newManager tlsManagerSettings\n print =\u003c\u003c getItem mgr (ItemId 1000)\n print =\u003c\u003c getUser mgr (UserId \"dmjio\")\n print =\u003c\u003c getMaxItem mgr\n print =\u003c\u003c getTopStories mgr\n print =\u003c\u003c getNewStories mgr\n print =\u003c\u003c getBestStories mgr\n print =\u003c\u003c getAskStories mgr\n print =\u003c\u003c getShowStories mgr\n print =\u003c\u003c getJobStories mgr\n print =\u003c\u003c getUpdates mgr\n```\n\n```bash\nRight ( Item {\n\t itemId = Just (ItemId 1000)\n   , itemDeleted = Nothing\n   , itemType = Story\n   , itemBy = Just (UserName \"python_kiss\")\n   , itemTime = Just (Time 1172394646)\n   , itemText = Nothing\n   , itemDead = Nothing\n   , itemParent = Nothing\n   , itemKids = Nothing\n   , itemURL = Just (URL \"http://www.netbusinessblog.com/2007/02/19/how-important-is-the-dot-com/\")\n   , itemScore = Just (Score 4)\n   , itemTitle = Just (Title \"How Important is the .com TLD?\")\n   , itemParts = Nothing\n   , itemDescendants = Just (Descendants 0)\n   })\nRight (User {userId = UserId \"dmjio\"\n\t\t   , userDelay = Nothing\n\t\t   , userCreated = Created 1375807763\n\t\t   , userKarma = Karma 7\n\t\t   , userAbout = Nothing\n\t\t   , userSubmitted = Just (Submitted [11966297,9355613, ...])\n\t\t   })\nRight (MaxItem 12695220)\nRight (TopStories [12694004,12692190,12691597,...])\nRight (NewStories [12695214,12695213,12695195,...])\nRight (BestStories [12649414,12637126,12684980, ...])\nRight (AskStories [12694706,12694401,12694038, ...])\nRight (ShowStories [12694004,12692190,12695037, ...])\nRight (JobStories [12693320,12691627,12690539,...])\nRight (Updates { items = [12694916,12694478,12693674,..],\n\t\t\t\t profiles = [UserName \"stefano\", UserName \"chillydawg\", ...]\n\t\t\t   })\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmjio%2Fhackernews","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmjio%2Fhackernews","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmjio%2Fhackernews/lists"}