https://github.com/cyteon/doubloon-leaderboard
A doubloons leaderboard for HackClub HighSeas
https://github.com/cyteon/doubloon-leaderboard
hackclub highseas
Last synced: about 1 month ago
JSON representation
A doubloons leaderboard for HackClub HighSeas
- Host: GitHub
- URL: https://github.com/cyteon/doubloon-leaderboard
- Owner: Cyteon
- License: agpl-3.0
- Created: 2024-12-18T14:27:49.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-02-21T18:34:11.000Z (3 months ago)
- Last Synced: 2025-03-30T10:04:30.814Z (2 months ago)
- Topics: hackclub, highseas
- Language: Svelte
- Homepage: https://doubloons.cyteon.hackclub.app/
- Size: 205 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Doubloon Leaderboard
> Uses actual data, but is opt-inNot much to type here, this is just a nice little leaderboard of the people with the most doubloons. \
To opt-in/out of the leaderboard, find the leaderboard section under the weeks top projects at [The Signpost](https://highseas.hackclub.com/signpost)## How does it work?
The leaderboard uses opted-in people's rank, which means it can only calculate ranking based on that \
There are two sorting modes, current doubloons, and all-time doubloons (all doubloons u have ever earned) \
You can also search for users, and they will appear if they are opted into the leaderboard \
Thanks to [@taciturnaxolotl](https://github.com/taciturnaxolotl) for implementing this on the signpost in PR https://github.com/hackclub/high-seas/pull/997## Api Routes
### /api/v1/data
**Parameters**:
- ?page=(integer) - Used for pagination, each page is 25 users
- ?sortBy=(current|total|spent) - How to sort the users, before slicing and returning 25 users based on page**Response**:
```js
{
users: [
{
username: String,
total_doubloons: Int,
current_doubloons: Int,
slack: String,
id: String
}
],pages: Int,
opted_in: Int,
time_since_last_update: Int
}
```### /api/v1/search
**Parameters**:
- ?id=(string) - ID to search by (response will have a "user" object instead of users array)
- ?username=(string) - Username to search by, (will have "users" array of matches)
- ?sortBy=(current|total|spent) - How to sort the matches (if search by username), and what rank to set on the rank property**Response**:
```js
{
// If search with ?username
users: [
{
username: String,
total_doubloons: Int,
current_doubloons: Int,
slack: String,
id: String,
rank: Int
}
],// If search with ?id
user: {
username: String,
total_doubloons: Int,
current_doubloons: Int,
slack: String,
id: String,
rank: Int
}pages: Int,
opted_in: Int,
time_since_last_update: Int
}
```### /api/v1/graph
**Parameters**:
- ?id=(string) - ID of the user to get graph points for**Response**:
```js
[
{
id: String,
doubloons: Int,
timestamp: String // ISO 8601
}
]
```\
\
\
\
--- This repo may contain code generated by copilot