Versions in this module Expand all Collapse all v1 v1.2.4 Apr 13, 2022 v1.2.3 Apr 13, 2022 v1.2.2 Apr 13, 2022 v1.2.1 Apr 13, 2022 v1.2.0 Apr 13, 2022 Changes in this version + const UserAgent + var ErrNotFound = fmt.Errorf("server responded with a 404") + var ErrNotOK = fmt.Errorf("server responded with a non-200") + var Timeout = time.Second * 15 + func Fetch(url string) ([]byte, error) + func FetchAndParse(url string) (*html.Node, error) + func GetAllTags(cb func(t []Tag)) error + func GetUserHTML(iurl string) ([]byte, error) + func GetUsersFromID(id int, cb func(u *User)) error + func QuerySelector(root *html.Node, selector string) (*html.Node, error) + func QuerySelectorAll(root *html.Node, selector string) ([]*html.Node, error) + type Article struct + CanonicalURL string + CollectionID int + CommentsCount int + CoverImage string + CreatedAt string + CrosspostedAt string + Description string + EditedAt string + ID int + LastCommentAt string + Path string + PositiveReactionsCount int + PublicReactionsCount int + PublishedAt string + PublishedTimestamp string + ReadablePublishDate string + Slug string + SocialImage string + TagList []string + Tags string + Title string + Type string + URL string + User User + func GetAllArticles(username string) ([]Article, error) + func GetArticles(username string, page int, limit int) ([]Article, error) + func ParseArticle(b []byte) (*Article, error) + func ParseArticles(b []byte) ([]Article, error) + func (a *Article) CreatedTime() (time.Time, error) + type Articles []Article + func (a Articles) JSON() ([]byte, error) + type Comment struct + Comment string + CreatedAt string + Title string + URL string + func (c *Comment) CreatedTime() (time.Time, error) + type Snapshot struct + Articles Articles + HTMLPage []byte + User User + UserPage UserPage + func GetSnapshot(id string) (ss *Snapshot, err error) + type Tag struct + BGColorHex string + ID int + Name string + TextColorHex string + func GetTags(page int) ([]Tag, error) + func ParseTag(b []byte) (*Tag, error) + func ParseTags(b []byte) ([]Tag, error) + type User struct + GithubUsername string + ID int + JoinedAt string + Location string + Name string + ProfileImage string + Summary string + TwitterUsername string + Type string + Username string + WebsiteURL string + func GetUserByID(id string) (*User, error) + func GetUserByUsername(username string) (*User, error) + func ParseUser(b []byte) (*User, error) + func (u *User) JSON() ([]byte, error) + func (u *User) JoinedAtTime() (time.Time, error) + func (u *User) URL() string + type UserPage struct + AvailableFor string + Badges []string + CommentCount int + Comments []Comment + Company string + CompanyURL string + Education string + Email string + Interests []string + Links []string + PostCount int + Skills []string + TagsFollowed int + Title string + func ParseUserPage(b []byte) (*UserPage, error) + func (u UserPage) JSON() ([]byte, error)