Skip to content

Commit

Permalink
Fix Necrolab URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
roncli committed Jan 8, 2024
1 parent 30a042f commit de4c855
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ services:
MASTODON_SERVER: "https://mastodon.social"
MINIFY_CACHE: 1
MINIFY_ENABLED: 1
NECROLAB_TOKEN_FILE: /run/secrets/NECROLAB_TOKEN_FILE
NODE_ENV: production
PHOTOS_URL: https://photos.roncli.com
PORT: 3030
Expand Down Expand Up @@ -129,6 +130,7 @@ services:
- ENCRYPTION_KEY_FILE
- GITHUB_TOKEN_FILE
- GOOGLE_API_KEY_FILE
- NECROLAB_TOKEN_FILE
- REDIS_PASSWORD_FILE
- SMTP_PASSWORD_FILE
- SOUNDCLOUD_CLIENT_ID_FILE
Expand Down Expand Up @@ -315,6 +317,8 @@ secrets:
file: ./secrets/MYSQL_PASSWORD_FILE
MYSQL_ROOT_PASSWORD_FILE:
file: ./secrets/MYSQL_ROOT_PASSWORD_FILE
NECROLAB_TOKEN_FILE:
file: ./secrets/NECROLAB_TOKEN_FILE
PHOTOS_USERNAME_FILE:
file: ./secrets/PHOTOS_USERNAME_FILE
PHOTOS_PASSWORD_FILE:
Expand Down
35 changes: 25 additions & 10 deletions node-roncli-com/src/necrolab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ class Necrolab {
*/
static async getRank(name) {
const res = await request.get({
uri: `https://necrolab.com/api/rankings/steam/all-time-any-percent-synchrony-amplified-single-player-ost/all/entries?search=${name}`,
json: true
uri: `https://www.necrolab.com/api/rankings/steam/all-time~any-percent~synchrony-amplified~single-player~ost/all/entries?search=${name}`,
json: true,
auth: {
bearer: process.env.NECROLAB_TOKEN
}
});

if (res.statusCode !== 200) {
Expand Down Expand Up @@ -63,8 +66,11 @@ class Necrolab {
*/
async () => {
const res = await request.get({
uri: `https://necrolab.com/api/rankings/steam/all-time-any-percent-synchrony-amplified-single-player-ost/all/entries/${rank}/leaderboards/time?limit=10000`,
json: true
uri: `https://www.necrolab.com/api/rankings/steam/all-time~any-percent~synchrony-amplified~single-player~ost/all/entries/${rank}/leaderboards/time?limit=10000`,
json: true,
auth: {
bearer: process.env.NECROLAB_TOKEN
}
});

if (res.statusCode !== 200) {
Expand All @@ -86,8 +92,11 @@ class Necrolab {
*/
async () => {
const res = await request.get({
uri: `https://necrolab.com/api/rankings/steam/all-time-any-percent-synchrony-amplified-single-player-ost/all/entries/${rank}/leaderboards/score?limit=10000`,
json: true
uri: `https://www.necrolab.com/api/rankings/steam/all-time~any-percent~synchrony-amplified~single-player~ost/all/entries/${rank}/leaderboards/score?limit=10000`,
json: true,
auth: {
bearer: process.env.NECROLAB_TOKEN
}
});

if (res.statusCode !== 200) {
Expand All @@ -109,8 +118,11 @@ class Necrolab {
*/
async () => {
const res = await request.get({
uri: `https://necrolab.com/api/rankings/steam/all-time-any-percent-synchrony-amplified-single-player-ost/all/entries/${rank}/leaderboards/wins?limit=10000`,
json: true
uri: `https://www.necrolab.com/api/rankings/steam/all-time~any-percent~synchrony-amplified~single-player~ost/all/entries/${rank}/leaderboards/wins?limit=10000`,
json: true,
auth: {
bearer: process.env.NECROLAB_TOKEN
}
});

if (res.statusCode !== 200) {
Expand Down Expand Up @@ -192,8 +204,11 @@ class Necrolab {
}

const res = await request.get({
uri: "https://necrolab.com/api/filters",
json: true
uri: "https://www.necrolab.com/api/filters",
json: true,
auth: {
bearer: process.env.NECROLAB_TOKEN
}
});

if (res.statusCode !== 200) {
Expand Down
2 changes: 1 addition & 1 deletion node-roncli-com/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ then
fi

# Run app.
exec env APPINSIGHTS_INSTRUMENTATIONKEY=$(cat $APPINSIGHTS_INSTRUMENTATIONKEY) env BLIZZARD_CLIENT_ID=$(cat $BLIZZARD_CLIENT_ID_FILE) env BLIZZARD_CLIENT_SECRET=$(cat $BLIZZARD_CLIENT_SECRET_FILE) env COOKIE_SECRET=$(cat $COOKIE_SECRET_FILE) env DISCORD_TOKEN=$(cat $DISCORD_TOKEN_FILE) env ENCRYPTION_KEY=$(cat $ENCRYPTION_KEY_FILE) env GITHUB_TOKEN=$(cat $GITHUB_TOKEN_FILE) env GOOGLE_API_KEY=$(cat $GOOGLE_API_KEY_FILE) env REDIS_PASSWORD=$(cat $REDIS_PASSWORD_FILE) env SMTP_PASSWORD=$(cat $SMTP_PASSWORD_FILE) env SOUNDCLOUD_CLIENT_ID=$(cat $SOUNDCLOUD_CLIENT_ID_FILE) env SOUNDCLOUD_CLIENT_SECRET=$(cat $SOUNDCLOUD_CLIENT_SECRET_FILE) env STEAM_API_KEY=$(cat $STEAM_API_KEY_FILE) env TUMBLR_CONSUMER_KEY=$(cat $TUMBLR_CONSUMER_KEY_FILE) env TWITCH_CLIENTID=$(cat $TWITCH_CLIENTID_FILE) env TWITCH_CLIENTSECRET=$(cat $TWITCH_CLIENTSECRET_FILE) env WEB_RONCLI_PASSWORD=$(cat $WEB_RONCLI_PASSWORD_FILE) env XIVAPI_API_KEY=$(cat $XIVAPI_API_KEY_FILE) node index
exec env APPINSIGHTS_INSTRUMENTATIONKEY=$(cat $APPINSIGHTS_INSTRUMENTATIONKEY) env BLIZZARD_CLIENT_ID=$(cat $BLIZZARD_CLIENT_ID_FILE) env BLIZZARD_CLIENT_SECRET=$(cat $BLIZZARD_CLIENT_SECRET_FILE) env COOKIE_SECRET=$(cat $COOKIE_SECRET_FILE) env DISCORD_TOKEN=$(cat $DISCORD_TOKEN_FILE) env ENCRYPTION_KEY=$(cat $ENCRYPTION_KEY_FILE) env GITHUB_TOKEN=$(cat $GITHUB_TOKEN_FILE) env GOOGLE_API_KEY=$(cat $GOOGLE_API_KEY_FILE) env NECROLAB_TOKEN=$(cat $NECROLAB_TOKEN_FILE) env REDIS_PASSWORD=$(cat $REDIS_PASSWORD_FILE) env SMTP_PASSWORD=$(cat $SMTP_PASSWORD_FILE) env SOUNDCLOUD_CLIENT_ID=$(cat $SOUNDCLOUD_CLIENT_ID_FILE) env SOUNDCLOUD_CLIENT_SECRET=$(cat $SOUNDCLOUD_CLIENT_SECRET_FILE) env STEAM_API_KEY=$(cat $STEAM_API_KEY_FILE) env TUMBLR_CONSUMER_KEY=$(cat $TUMBLR_CONSUMER_KEY_FILE) env TWITCH_CLIENTID=$(cat $TWITCH_CLIENTID_FILE) env TWITCH_CLIENTSECRET=$(cat $TWITCH_CLIENTSECRET_FILE) env WEB_RONCLI_PASSWORD=$(cat $WEB_RONCLI_PASSWORD_FILE) env XIVAPI_API_KEY=$(cat $XIVAPI_API_KEY_FILE) node index

0 comments on commit de4c855

Please sign in to comment.