{"id":24956869,"url":"https://github.com/andrewstuart/go-hnfire","last_synced_at":"2025-03-28T20:38:09.247Z","repository":{"id":57578741,"uuid":"41778725","full_name":"andrewstuart/go-hnfire","owner":"andrewstuart","description":"Hackernews Firebase Library","archived":false,"fork":false,"pushed_at":"2015-09-19T20:32:33.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T06:41:57.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/andrewstuart.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":"2015-09-02T03:56:17.000Z","updated_at":"2015-09-02T03:57:14.000Z","dependencies_parsed_at":"2022-09-26T19:11:16.864Z","dependency_job_id":null,"html_url":"https://github.com/andrewstuart/go-hnfire","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/andrewstuart%2Fgo-hnfire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fgo-hnfire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fgo-hnfire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fgo-hnfire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewstuart","download_url":"https://codeload.github.com/andrewstuart/go-hnfire/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246100418,"owners_count":20723466,"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":[],"created_at":"2025-02-03T06:41:28.615Z","updated_at":"2025-03-28T20:38:09.223Z","avatar_url":"https://github.com/andrewstuart.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hnfire\n--\n    import \"github.com/andrewstuart/hnfire\"\n\n\n## Usage\n\n#### func  GetFP\n\n```go\nfunc GetFP(depth int) ([]*Item, error)\n```\nGetFP returns an array of the front page to given depth. It will do so\nconcurrently and may currently open too many connections. This will likely be\nfixed by pooling connections.\n\n#### func  Watch\n\n```go\nfunc Watch(uri string, evCh chan *Event) \u003c-chan error\n```\nWatch takes an endpoint and an event channel the event channel on updates to the\nresource\n\n#### type Endpoint\n\n```go\ntype Endpoint string\n```\n\nAn Endpoint is a convenience function for getting nested API strings.\n\n#### func (Endpoint) Child\n\n```go\nfunc (ep Endpoint) Child(format string, args ...interface{}) Endpoint\n```\nChild returns the current endpoint concatenated with the result of formatting\nthe given format string with the passed arguments.\n\n#### func (Endpoint) String\n\n```go\nfunc (ep Endpoint) String() string\n```\nString returns the Endpoint's underlying string value\n\n#### type Event\n\n```go\ntype Event struct {\n\tPath          string\n\tURI           string\n\tBody          io.Reader\n\tOriginalEvent *sse.Event\n}\n```\n\nEvent is a firebase-specific structure representing the path and data for an\nevent.\n\n#### type Item\n\n```go\ntype Item struct {\n\tType        string  `json:\"type\"`\n\tAuthor      string  `json:\"by\"`\n\tTitle       string  `json:\"title\"`\n\tText        string  `json:\"text\"`\n\tURL         string  `json:\"url\"`\n\tDescendants int     `json:\"descendants\"`\n\tID          int     `json:\"id\"`\n\tPoints      int     `json:\"score\"`\n\tChildrenIDs []int   `json:\"kids,omitempty\"`\n\tChildren    []*Item `json:\"children\"`\n\tRank        int\n}\n```\n\nItem represents an hn story or comment, specific to the way FireBase represents\nthem.\n\n#### func  NewItem\n\n```go\nfunc NewItem(id int, depth int) (*Item, error)\n```\nNewItem returns an item and all its children to `depth`. If depth is zero, no\nrecursion happens.\n\n#### func (*Item) Refresh\n\n```go\nfunc (i *Item) Refresh() error\n```\nRefresh updates the item using the FireBase api.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewstuart%2Fgo-hnfire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewstuart%2Fgo-hnfire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewstuart%2Fgo-hnfire/lists"}