Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Page ¶
type Page struct { Posts []Post // All the posts on the page Num int // The page number. Page 1 is the homepage/mainpage Retrieved time.Time // The time the request for the page was completed }
A Page is an entire page on HackerNews. It holds every Post on the page and tracks when the retrieval was done.
func ScrapeMultPages ¶
ScrapeMultPages scrapes all pages from the starting page number to the ending page number, inclusive.
func ScrapePage ¶
ScrapePage scrapes a single page from HackerNews. Use '1' for the homepage/mainpage.
type Post ¶
type Post struct { Rank int // The rank of the post, ie. rank 2 means it's the second highest post on the site Title string // The title of the post Score int // How many 'points' the post has received from voting By string // The username of the user that submitted the post URL string // The url link that the post is linking to NumComments int // How many comments were made on the post at the time of access TimePosted time.Time // Timestamp when the post was submitted }
A Post is a single HackerNews post and the attributes associated with it.
Click to show internal directories.
Click to hide internal directories.