Coder Social home page Coder Social logo

osrs-tracker / osrs-tracker-aws Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 672 KB

This repository contains the AWS code and configuration for OSRS Tracker.

License: MIT License

JavaScript 14.50% TypeScript 85.50%
aws aws-lambda grand-exchange hiscores osrs osrs-tracker runescape

osrs-tracker-aws's Introduction

OSRS Tracker AWS · GitHub license GitHub issues · CI

This repository contains the AWS code and configuration for OSRS Tracker, an application designed to track item prices and player information in the game Old School RuneScape.

Lambda functions

Schedule Driven

  • osrs-tracker_refresh-items

    This function fetches all items and latest prices from prices.runescape.wiki/api/v1/osrs, merges them into an Item object and upserts all items to MongoDB every hour.

  • osrs-tracker_queue-players

    This function fetches all players that have opted in for tracking at a particular UTC offset, and pushes them to a SQS queue where they will wait to be processed.

    Calculates current offset from the ScheduledEvent and queries MongoDB for players that have opted in for tracking at that specific offset.

  • osrs-tracker_process-players

    This function fetches OSRS hiscores for the provided usernames, and prepends the hiscore to the player.hiscoreEntries array.

  • osrs-tracker_hiscore-parser-validator

    This function fetches the hiscores every hour for a few test usernames and will run the parseHiscoreString function from the @osrs-tracker/hiscores package to test if the current parser is still valid, and no api changes have happened.

  • osrs-tracker_clean-hiscores

    This function deletes all hiscores older then 60 days from the data base every day at UTC midnight.

API Gateway driven

  • osrs-tracker_item-info

    When sending a GET /:id request, this function returns item details from MongoDB.

  • osrs-tracker_item-search

    When sending a GET /:query request, this function returns items from MongoDB where the name partially matches the provided query. It also adds a confidence score property.

  • osrs-tracker_player-hiscores

    When sending a GET /:username(?size=7&skip=0&scrapingOffset=0) request, this function returns scraped player hiscoreEntries for the provided username from MongoDB.

  • osrs-tracker_player-info

    When sending a GET /:username(?scrapingOffset=0&hiscore=false) request, this function returns player information for the provided username from MongoDB, or attempts to scrape it if not found in MongoDB.

    The scrapingOffset will be added to the player.scrapingOffsets if it's not present yet, and will be used filter hiscoreEntries when hiscore=true. An initial hiscoreEntry will also be pushed if it's the first time the player was fetched with this specific scrapingOffset.

    By default, the returned player does not include hiscoreEntries. However, if the query parameter hiscore=true is included in the request, the function will also include the player's most recent hiscore entry matching the scrapingOffset.

    The function automatically refreshes the player info when information from MongoDB is older than 2 hours.

osrs-tracker-aws's People

Contributors

freekmencke avatar

Stargazers

 avatar

Watchers

 avatar  avatar

osrs-tracker-aws's Issues

No datapoints for 31 dec and 1 jan

Apparantly 31 dec and 1 jan weren't tracked because when we crossed the 100 tracked players treshold it caused the osrs-tracker_queue-players lambda function to throw an error.

Add a way to fetch the latest hiscore entry for multiple players

This will be necessary for the XP Tracker player widgets. Where we can see how much overall XP our recent and favorite players have earned today.

We can create new lambda function, or update osrs-tracker_player-hiscores to also accept GET /?usernames= besides GET /:username.

TBD

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.