{"id":28965947,"url":"https://github.com/devflowinc/hackernews-ingest","last_synced_at":"2025-06-24T07:10:39.580Z","repository":{"id":247705679,"uuid":"826622728","full_name":"devflowinc/hackernews-ingest","owner":"devflowinc","description":"Scripts to ingest hackernews","archived":false,"fork":false,"pushed_at":"2024-07-10T04:30:04.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-22T05:17:05.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devflowinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-10T04:17:59.000Z","updated_at":"2024-07-10T04:30:07.000Z","dependencies_parsed_at":"2024-07-10T06:56:01.178Z","dependency_job_id":null,"html_url":"https://github.com/devflowinc/hackernews-ingest","commit_stats":null,"previous_names":["devflowinc/hackernews-ingest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devflowinc/hackernews-ingest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devflowinc%2Fhackernews-ingest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devflowinc%2Fhackernews-ingest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devflowinc%2Fhackernews-ingest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devflowinc%2Fhackernews-ingest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devflowinc","download_url":"https://codeload.github.com/devflowinc/hackernews-ingest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devflowinc%2Fhackernews-ingest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261624969,"owners_count":23186121,"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-06-24T07:10:38.929Z","updated_at":"2025-06-24T07:10:39.561Z","avatar_url":"https://github.com/devflowinc.png","language":"Python","readme":"# Hackernews Ingest\n\nThis consists of 3 scripts each that are pretty self contained.\n\n1. set-ids \n\n1) Get the max current max post id [https://hacker-news.firebaseio.com/v0/maxitem.json](https://hacker-news.firebaseio.com/v0/maxitem.json).\n2) Read from redis of the last value written (redis key is called `last_final`)\n3) From `last_final` to `max` push these values into a list called `tovisit`\n\n2. get-dataset\n\n1) Pop an item off the `tovisit` redis list\n2) Request for post that post id f\"https://hacker-news.firebaseio.com/v0/item/{start}.json\"\n3) If that value exists, and is not deleted. Push the json response from `2` into redis list `hn` \n\n3. bulk-ingest\n\n1) Pop 120 json items from redis\n2) Format each into a trieve chunk\n3) Make a POST request to trieve `/api/chunk` to create the data\n4) Push the json items into redis list `sent` (just so we can skip scripts 1 and 2)\n\n### Running it\n\nWe run all the following scripts in kubernetes as deployments.\n\n```sh\nkubectl apply -f set-ids/set-ids.yaml\nkubectl apply -f get_dataset/get-datasets.yaml\nkubectl apply -f bulk_ingest/bulk_send.yaml\n```\n\nAll scripts can be horizontally scaled exceptfor `set-ids.yaml`, but it runs much faster than the other 2 so no need to worry\n\nScaling is pretty easy with \n```sh\nkubectl scale --replicas 3 deploy/bulksend\nkubectl scale --replicas 50 deploy/get-datasets\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevflowinc%2Fhackernews-ingest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevflowinc%2Fhackernews-ingest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevflowinc%2Fhackernews-ingest/lists"}