{"id":15435399,"url":"https://github.com/neuodev/pokemon-indexer","last_synced_at":"2026-07-18T02:32:39.829Z","repository":{"id":139101078,"uuid":"525114080","full_name":"neuodev/pokemon-indexer","owner":"neuodev","description":"A simple Rust program to download all of the 15,000 pokemon images on pkmncards.","archived":false,"fork":false,"pushed_at":"2022-08-16T17:45:00.000Z","size":28210,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T02:48:49.457Z","etag":null,"topics":["pokemon","pokemon-api","rust","tokio"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/neuodev.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":"2022-08-15T19:32:02.000Z","updated_at":"2022-08-27T13:46:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"05739988-e235-470c-9103-178fa6b9c4e4","html_url":"https://github.com/neuodev/pokemon-indexer","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":0.09090909090909094,"last_synced_commit":"23c19bd00b014d0ffe46094ab2fd68c16ce551ca"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fpokemon-indexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fpokemon-indexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fpokemon-indexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fpokemon-indexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuodev","download_url":"https://codeload.github.com/neuodev/pokemon-indexer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978277,"owners_count":20703678,"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":["pokemon","pokemon-api","rust","tokio"],"created_at":"2024-10-01T18:44:09.414Z","updated_at":"2025-10-15T04:54:06.317Z","avatar_url":"https://github.com/neuodev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pokemon Indexer\n\nA simple Rust program to download all of the **15,000** pokemon images on [pkmncards](https://pkmncards.com/?s=).\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./pokemon.png\" /\u003e\n\u003c/p\u003e\n\nThere is about **252** pages on website at the time of creating of this PR every page has about **60** image. the output of the program should be in a folder called `output` which should include the all the pages represented as directories and every directoy has the 60 images.\n\n```bash\n--output\n  |\n  ------- page (idx 1..=252)\n            |\n            -----image (idx 1..=60).png\n  ...... other 251 directories\n```\n\n# How it works?\n\nI am using **tokio** to be able to spen up multiple asynchronous tasks. Due to the network limitation I am running about `5` tasks for `5` page and then another `60` tasks for each page this is about `5 * 60 = 360` image running at the same time. Becuase we have 252 page it will take about 51 iterations to download all of the images.\n\nThis process might take some time. You can consider running the program as a **backgorund process** using **[pm2](https://pm2.keymetrics.io/)**.\n\n# How to run?\n\nYou can pass the following arguments\n| Argument | desc| type | default | note|\n| --------- | ----| ----- | ------- | ----|\n| page (-p) | Number of pages to process at the same time | `u8` | `5` | |\n| json (-j)| Save all images urls into a json file| `bool` | `flase` | Required to be able to run the web server|\n| save-images (-s)| Save all fetched images| `bool` | `flase` | |\n| addr | server binding address| `socketAddr` | `127.0.0.1:8080` | |\n\n### examples\n\n```bash\n# Only output a json file with all of the urls\n[exe] -p 12 -j\n# Process 20 pages in parallel ans save all of the output images\n[exe] -p 20 -s\n# Run the server on a different port\n[exe] --addr 127.0.0.1:3000\n# Get all commands\n[exe] -h\n```\n\n```bash\n\nUSAGE:\n    pokemon-cards.exe [OPTIONS]\n\nOPTIONS:\n        --addr \u003cADDR\u003e      [default: 127.0.0.1:8080]\n    -h, --help             Print help information\n    -j, --json\n    -p, --pages \u003cPAGES\u003e    [default: 5]\n    -s, --save-images\n    -V, --version          Print version information\n```\n\n## Run with one of the previous arguments\n\n1. build the binary to your target platform using\n\n   ```bash\n   cargo run --release\n   ```\n\n2. Run the program using one of these two ways\n\n   a.\n\n   ```bash\n    /target/release/pokemon-cards #.exe for windows\n   ```\n\n   b. Use **pm2**. You will need to have NodeJS installed and then you can install pm2\n\n   ```bash\n   npm install -g pm2\n   ```\n\n   Check your installation by running\n\n   ```bash\n   pm2 --version\n   ```\n\n   Run the binary as background script. All the configs to run the program is found in `ecosystem.config.js` file\n\n   ```bash\n    pm2 start ecosystem.config.js\n   ```\n\n   To check the logs of the programs run\n\n   ```bash\n    pm2 log\n   ```\n\n   To stop or delete or restart the program use\n\n   ```bash\n   pm2 stop|delete|restart ecosystem.config.js\n   ```\n\n# API\n\n`GET /api/v1/pokemon`\n\n| Query     | type  | default | desc                |\n| --------- | ----- | ------- | ------------------- |\n| page      | `i32` | `1`     | current page nubmer |\n| page_size | `i32` | `10`    | Items perpage       |\n\n### Example\n\n```\nGET /api/v1/pokemon?page=1\u0026page_size=20\n```\n\nresponse\n\n```json\n{\n  \"urls\": [\n    /*Array of all the urls*/\n  ],\n  \"count\": 14400,\n  \"num_of_pages\": 1200\n}\n```\n\n## Example website\n\n[![Watch the video](./sample.png)](./example.mp4)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuodev%2Fpokemon-indexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuodev%2Fpokemon-indexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuodev%2Fpokemon-indexer/lists"}