Skip to content

Sche7/osrs

Repository files navigation

Fetch Hiscores from Old School Runescape

Easily fetch your OSRS user hiscores with the following:

from runescape.api.osrs.hiscores import Hiscores

user = Hiscores("Zehahandsome")
print(user.character)

Discord Webhook

This repo also provides a Discord webhook that uses AWS Cloud in the background to log and report progress to a desired Discord channel. This will continuously provide progress every 7 days to your Discord channel:

Discord webhook example

To setup Discord webhook, you will have to first install:

  1. AWS CLI
  2. Terraform

NOTE: Remember to configure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY either as environment variables or within the AWS CLI configuration.

When AWS CLI and Terraform is installed, create a setup.tfvars file in the terraform/ folder. The content of the .tfvars file should look something similar to:

osrs_usernames = ["osrs_user1", "osrs_user2"]  # List of the OSRS users to track progress
osrs_remote_folder = "hiscores"  # Prefix for S3 object keys that will hold level information of OSRS users from `osrs_usernames`
discord_webhook_url = "https://discordapp.com/api/webhooks/123456789/blabla-f456ds-this-is-a-fake-url"  # Discord webhook URL

NOTE: To get the Discord Webhook URL look in Discord > Server Settings > APPS > Integrations > Webhooks

From the repository root, run:

make setup-discord-webhook-infra

To destroy all the created resources again, run:

make destroy-discord-webhook-infra

Development

Testing

To run tests in this repository, follow these steps:

  1. Make sure you have the necessary environment variables set up. These variables are required for the tests to run successfully.

    DISCORD_WEBHOOK=...
    AWS_ACCESS_KEY_ID=...
    AWS_SECRET_ACCESS_KEY=...
  2. Run the test command in your terminal or command prompt:

    make test-unit

    This run all the unit tests in the tests directory. To run all tests including the AWS tests, do

    make test-aws

    This requires all the enviroment variables to be set from step 1.

  3. Check the test results in the terminal or command prompt. Any failures or errors will be displayed, allowing you to identify and fix any issues.

Note: If you encounter any issues related to environment variables, make sure they are correctly set up and accessible to the test environment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •