Copyright | (c) David Johnson 2014-2016 |
---|---|
Maintainer | djohnson.m@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Web.HackerNews.Types
Description
Haskell port of https://github.com/HackerNews/API
- data Updates = Updates {}
- newtype MaxItem = MaxItem ItemId
- newtype TopStories = TopStories [ItemId]
- newtype NewStories = NewStories [ItemId]
- newtype BestStories = BestStories [ItemId]
- newtype AskStories = AskStories [ItemId]
- newtype ShowStories = ShowStories [ItemId]
- newtype JobStories = JobStories [ItemId]
- data User = User {}
- newtype Karma = Karma Int
- newtype UserId = UserId Text
- newtype Delay = Delay Int
- newtype Created = Created Int
- newtype About = About Text
- newtype Submitted = Submitted [ItemId]
- newtype ItemId = ItemId Int
- newtype Deleted = Deleted Bool
- data ItemType
- newtype UserName = UserName Text
- newtype ItemText = ItemText Text
- newtype Dead = Dead Bool
- newtype Parent = Parent ItemId
- newtype Time = Time Integer
- newtype Kids = Kids [ItemId]
- newtype URL = URL Text
- newtype Score = Score Int
- newtype Title = Title Text
- newtype Parts = Parts [ItemId]
- newtype Descendants = Descendants Int
- data Item = Item {
- itemId :: Maybe ItemId
- itemDeleted :: Maybe Deleted
- itemType :: ItemType
- itemBy :: Maybe UserName
- itemTime :: Maybe Time
- itemText :: Maybe ItemText
- itemDead :: Maybe Dead
- itemParent :: Maybe Parent
- itemKids :: Maybe Kids
- itemURL :: Maybe URL
- itemScore :: Maybe Score
- itemTitle :: Maybe Title
- itemParts :: Maybe Parts
- itemDescendants :: Maybe Descendants
- data HackerNewsError
Documentation
The item and profile changes are at https://hacker-news.firebaseio.com/v0/updates
The current largest item id is at https://hacker-news.firebaseio.com/v0/maxitem. You can walk backward from here to discover all items.
Users are identified by case-sensitive ids, and live under https://hacker-news.firebaseio.com/v0/user/. Only users that have public activity (comments or story submissions) on the site are available through the API.
Constructors
User | |
Fields
|
The user's karma.
The user's unique username. Case-sensitive. Required.
Delay in minutes between a comment's creation and its visibility to other users.
Creation date of the user, in Unix Time.
The user's optional self-description. HTML.
List of the user's stories, polls and comments.
The item's unique id.
true
if the item is deleted.
The type of item. One of "job", "story", "comment", "poll", or "pollopt"
The username of the item's author.
The comment, story or poll text. HTML.
true
if the item is dead.
The item's parent. For comments, either another comment or the relevant story. For pollopts, the relevant poll.
Creation date of the item, in Unix Time.
The ids of the item's comments, in ranked display order.
The URL of the story.
The story's score, or the votes for a pollopt.
The title of the story, poll or job.
A list of related pollopts, in display order.
newtype Descendants #
In the case of stories or polls, the total comment count.
Constructors
Descendants Int |
Instances
Stories, comments, jobs, Ask HNs and even polls are just items. They're identified by their ids, which are unique integers, and live under https://hacker-news.firebaseio.com/v0/item/.
Constructors
Item | |
Fields
|
data HackerNewsError #
Error handling for HackerNewsAPI
Constructors
NotFound | |
FailureResponseError Int Text Text | |
HNConnectionError Text | |
DecodeFailureError Text Text | |
InvalidContentTypeHeaderError Text Text | |
UnsupportedContentTypeError Text |
Instances