{"id":16549080,"url":"https://github.com/hzoo/geturf","last_synced_at":"2025-10-10T11:37:20.834Z","repository":{"id":30561256,"uuid":"34116085","full_name":"hzoo/geturf","owner":"hzoo","description":"Fetches URF data.","archived":false,"fork":false,"pushed_at":"2015-05-05T03:03:19.000Z","size":256,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-14T16:56:23.856Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/hzoo.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}},"created_at":"2015-04-17T12:44:28.000Z","updated_at":"2015-05-05T03:03:19.000Z","dependencies_parsed_at":"2022-08-17T19:45:24.474Z","dependency_job_id":null,"html_url":"https://github.com/hzoo/geturf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hzoo%2Fgeturf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hzoo%2Fgeturf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hzoo%2Fgeturf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hzoo%2Fgeturf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hzoo","download_url":"https://codeload.github.com/hzoo/geturf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241858336,"owners_count":20032119,"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":"2024-10-11T19:28:09.022Z","updated_at":"2025-10-10T11:37:15.813Z","avatar_url":"https://github.com/hzoo.png","language":"JavaScript","readme":"GetUrf\n---\n\nFor the [Riot Games API Challenge](https://developer.riotgames.com/discussion/riot-games-api/show/bX8Z86bm).\nFetch URF match data and send to a database.\n\n![](screenshot.png)\n\n## Data Flow\n1. Get 5 minute timestamps starting from `1427866500` (for `NA`).\n2. Send timestamps to the endpoint `api-challenge-v4.1` to get a list of URF match IDs.\n2. For each match ID, get match data from the endpoint `match-v2.2`.\n3. Transform result (remove unused fields, etc).\n    4. Create tables for matches, players, bans.\n4. Save to the database (firebase -\u003e local -\u003e server db).\n6. Figure out queries to send to site + Visualize (https://github.com/hzoo/urf).\n\n## Setup\n- [io.js](https://iojs.org/): `nvm install 1.6.3 \u0026\u0026 nvm use 1.6.3`\n- ES6 with Babel\n- MySQL 5.6 (local or server): `apt-get install mysql-server`\n    + Setup a database and name it what you will put in `DB_NAME`.\n    + Add all the tables from `./data/create-tables.js`\n\nCreate a json file at `./data/config.json`.\n\n```js\n{\n    \"LOL_REGION\": \"LOL-REGION-HERE\", // ex: na\n    \"LOL_TOKEN\": \"LOL-API-TOKEN-HERE\",\n    \"DB_HOST\": \"DB-HOST-HERE\", // localhost unless you use a service\n    \"DB_USER\": \"DB-USER-HERE\",\n    \"DB_PASSWORD\": \"DB-PASSWORD-HERE\",\n    \"DB_NAME\": \"DB-DATABASE-NAME\",\n    \"SSL_CA\": \"blah.pem\",\n    \"SSL_CERT\": \"blah.pem\",\n    \"SSL_KEY\": \"blah.pem\"\n}\n```\n\nrun `npm start`\n\n## Structure\n- `npm start` runs `fetch/index.js`\n    + This sets up the database and lolapi wrapper\n- `fetch/fetch-urf-game-ids.js` is run\n    + This specificially fetches the URF matchIds by computing each 5 minute time interval (just add 300 to the timestamp) (starting with some initial value) and continuing to send arrays of matchIds to the database.\n- `fetch/fetch-urf-match-data.js` is run\n    + This fetches the match data and removes data not used and modifies it so the data can be put in the different database tables (matches, players (each game), and bans.\n- This was able to continuously run until all the matches were fetched in a region and then I would change the `LOL_REGION` config.\n\n## Misc\n- Running on Heroku (It's fetches different regions by changing the LOL_REGION config var).\n- Database is using Cloud SQL (tested locally).\n- It ended up being a lot easier/faster to just work with things I've used before or have some experience with rather than trying to use something new.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhzoo%2Fgeturf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhzoo%2Fgeturf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhzoo%2Fgeturf/lists"}