A relatively basic program designed to search the API of speedrun.com for new runs in the new, verified, and rejected categories, then subsequently store them in a MongoDB database. Designed for a serverless model running on an interval, working alongside another function to respond to webhooks for each run.
This application is not intended to be used yet, as it currently misses features such as pagination. These instructions are primarily for collaborators developing the project.
Run the following commands in the desired location (other than $GOPATH):
git clone https://github.com/SRCStats/src-webhook-fetcher.git
cd src-webhook-fetcher
Configure a new MongoDB instance, or use an existing one. (Azure Cosmos DB w/ MongoDB API is used in production, but any will do.) Run the following commands to set the environment variables: The {Value} fields are placeholders.
setx SRC_WEBHOOK_MONGODB_CONNECTION_STRING {Connection_String}
setx SRC_WEBHOOK_DATABASE {Database_Name} &:: "srcstats" Recommended
setx SRC_WEBHOOK_COLLECTION {Collection_Name} &:: "webhook-last-runs" Recommended
setx SRC_WEBHOOK_RUN_URI {src-webhook-sender url} &:: Set to http://localhost if not required
# This is temporary for your current terminal session, add these commands to your .bashrc or .bash_profile to persist across sessions
export SRC_WEBHOOK_MONGODB_CONNECTION_STRING={Connection_String}
export SRC_WEBHOOK_DATABASE={Database_Name} # "srcstats" Recommended
export SRC_WEBHOOK_COLLECTION={Collection_Name} # "webhook-last-runs" Recommended
export SRC_WEBHOOK_RUN_URI {src-webhook-sender url} # Set to http://localhost if not required
Finally, run the following go commands to finish the configuration and run the project:
go get ./...
go run fetch.go
This project is licensed under the Anti-Capitalist Software License. See LICENSE for more information.