Skip to content

SRCStats/src-webhook-fetcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SRC Webhook Fetcher

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.

Configuration

IMPORTANT

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.

Windows

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

Mac/Linux

# 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

License

This project is licensed under the Anti-Capitalist Software License. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages