Skip to content

Instantly share code, notes, and snippets.

@zt3h
Created November 20, 2021 10:17
Show Gist options
  • Save zt3h/809b7bf5a98b851317dc50e13e89ef7f to your computer and use it in GitHub Desktop.
Save zt3h/809b7bf5a98b851317dc50e13e89ef7f to your computer and use it in GitHub Desktop.
Code Example in JS for /networth/categories
const axios = require('axios');
const getActiveProfile = function (profiles, uuid) {
return profiles.sort((a, b) => b.members[uuid].last_save - a.members[uuid].last_save)[0];
};
const getNetworth = async function (uuid, key) {
const { data } = await axios.get(`https://api.hypixel.net/skyblock/profiles?key=${key}&uuid=${uuid}`);
const activeProfile = getActiveProfile(data.profiles, uuid);
const profile = activeProfile.members[uuid];
profile.banking = activeProfile.banking;
const response = await axios.post('https://nariah-dev.com/api/networth/categories', { data: profile });
return response.data;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment