{"id":15211506,"url":"https://github.com/djdavid98/speedruncommonitor","last_synced_at":"2025-03-11T07:16:07.149Z","repository":{"id":243988282,"uuid":"813972474","full_name":"DJDavid98/SpeedrunComMonitor","owner":"DJDavid98","description":"Automatically post new Speedrun.com runs in a Discord channel of your choice. Not affiliated with Speedrun.com.","archived":false,"fork":false,"pushed_at":"2024-10-26T22:41:51.000Z","size":98,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T21:44:11.168Z","etag":null,"topics":["discord","discord-channel","discord-webhook","discord-webhook-notifications","discordjs","esm","feed","node-pg-migrate","nodejs","notifications","speedruncom","ts-node","typeorm","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/DJDavid98.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-12T05:17:32.000Z","updated_at":"2024-10-26T22:41:54.000Z","dependencies_parsed_at":"2024-06-12T11:28:01.707Z","dependency_job_id":"a94942c9-8fc5-4e4d-a511-f0e423357825","html_url":"https://github.com/DJDavid98/SpeedrunComMonitor","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"77944fef03272d473c6442d725ffb87a8427e471"},"previous_names":["djdavid98/speedruncommonitor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJDavid98%2FSpeedrunComMonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJDavid98%2FSpeedrunComMonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJDavid98%2FSpeedrunComMonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJDavid98%2FSpeedrunComMonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DJDavid98","download_url":"https://codeload.github.com/DJDavid98/SpeedrunComMonitor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242988055,"owners_count":20217539,"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":["discord","discord-channel","discord-webhook","discord-webhook-notifications","discordjs","esm","feed","node-pg-migrate","nodejs","notifications","speedruncom","ts-node","typeorm","typescript"],"created_at":"2024-09-28T08:41:58.379Z","updated_at":"2025-03-11T07:16:07.100Z","avatar_url":"https://github.com/DJDavid98.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SpeedrunComMonitor\n\nAutomatically post new verified Speedrun.com runs in a Discord channel of your choice. Not affiliated with Speedrun.com.\n\nThis project uses webhooks to save system resources by only pushing data when necessary.\n\nEach run of the script will store the messages it already sent in a PostgreSQL database to prevent duplicate messages.\n\n## Basic usage\n\n1. Copy `.env.example` to `.env` (the latter is ignored from version control intentionally)\n2. Fill out the necessary values\n    - `DISCORD_WEBHOOK_URL` must be a full webhook URL (see [Intro to Webhooks])\n    - `DATABASE_URL` must be a PostgreSQL database connection string (including all necessary connection parameters)\n    - `USER_AGENT` is a free-text identifier for all requests going to Speedrun.com (they [ask very nicely] to make it descriptive)\n    - `POST_VERIFIED_AFTER` can be left blank, but when an [ISO 8601] standard timestamp is specified, runs verified before that timestamp are ignored\n3. `npm ci`\n4. `npm run migrate up`\n5. Import `setup/seed.sql` (tweak as necessary)\n6. `npm run start`\n\n[Intro to Webhooks]: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks\n\n[ask very nicely]: https://github.com/speedruncomorg/api?tab=readme-ov-file#basics\n\n[ISO 8601]: https://en.wikipedia.org/wiki/ISO_8601\n\nThis will send the found runs as messages to the provided webhook and save them in the database simultaneously.\n\nIt does NOT detect existing messages in the channel. If you clear the DB any existing messages WILL be reposted.\n\n## Advanced usage\n\n### Creating subscriptions\n\nSubscriptions can only be added manually via DB editing at this time. Each subscription needs a `gameId` and it must also have the `active` column set to `true` in order to be checked by the script.\n\nThe rest of the fields can be left as their default values. `en-US` is the only `locale` that really makes sense right now, considering the lack of translations and message customizability, but this must be set to make sure time and ordinal number formatting doesn't break.\n\nTo find a game's ID, you can use the Speedrun.com API directly. Simply take the url below and substitute `split/second` for the name of the game you want to track:\n\nhttps://www.speedrun.com/api/v1/games?name=split/second\n\nOpen this link in your browser and look for the `\"id\": \"…\"` part of the output, in this case `m1zg3360`.\n\nIf you want to have convenience scripts for any of this, open an issue to request it.\nThe tool works for my needs, and I don't want to add stuff that I personally don't need.\n\n### Migrations\n\nDatabase structure changes are handled via [node-pg-migrate]\n\n```\n$ npm run migrate create migration-name\n$ npm run migrate up\n$ npm run migrate down\n```\n\n[node-pg-migrate]: https://www.npmjs.com/package/node-pg-migrate\n\nMigrations should be run after each new migration added to the project to keep the database in sync with the code.\n\n### Persistent process\n\nThe project comes with a `pm2.json` file which can be run through [pm2] which will re-run the script every hour by default.\n\n[pm2]: https://www.npmjs.com/package/pm2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjdavid98%2Fspeedruncommonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjdavid98%2Fspeedruncommonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjdavid98%2Fspeedruncommonitor/lists"}