Skip to content

Commit

Permalink
Updates for Hottest 200
Browse files Browse the repository at this point in the history
  • Loading branch information
jono-hayward committed Jan 26, 2025
1 parent a39885b commit fee38c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 7 additions & 4 deletions app/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ export const compose = async ( song, config ) => {
};

// Used during Hottest 100
// if ( track.count ) {
// lines.push( `🥁 2024 Hottest 100 - #${track.count}`, `` );
// }
if ( song.count ) {
console.log('Track count found!');
lines.push( `🥁 2024 Hottest 200 - #${song.count}`, `` );
} else {
console.log('No track count found :(');
}

lines.push(
`${clockEmoji( config.timezone, song.started )} ${song.started.toLocaleTimeString( 'en-AU', timeOptions )}`,
Expand Down Expand Up @@ -102,4 +105,4 @@ export const compose = async ( song, config ) => {
genius && addLink( postObject, 'Lyrics', genius );

return postObject;
}
}
8 changes: 6 additions & 2 deletions app/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SpotifyWebApi from "spotify-web-api-node";
import YouTubeMusicAPI from "youtube-music-api";

export const parse = (song) => {
const { played_time, recording, release } = song;
const { played_time, recording, release, count } = song;
const { title: recordingTitle, artists, artwork, releases } = recording || {};

if (played_time && recordingTitle && artists) {
Expand All @@ -15,6 +15,10 @@ export const parse = (song) => {
album: release?.title || "",
};

if (count) {
result.count = count;
}

if (artists[0].links && artists[0].links.length) {
const link = artists[0].links[0];
if (link.service_id === "unearthed") {
Expand Down Expand Up @@ -267,4 +271,4 @@ export const searchGenius = async (song, debug = false) => {
}

return false;
}
}
2 changes: 1 addition & 1 deletion app/scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const timeOptions = {
};

// Begin talking to Bluesky
console.log('🪵 Logging in to Bluesky');
console.log('🪵 Logging in to Bluesky');
const agent = new BskyAgent({ service: "https://bsky.social" });
await agent.login({
identifier: config.bsky_username,
Expand Down

0 comments on commit fee38c6

Please sign in to comment.