diff --git a/src/_data/weeklyArtistChart.js b/src/_data/weeklyArtistChart.js index 9c2790de..1a547c55 100644 --- a/src/_data/weeklyArtistChart.js +++ b/src/_data/weeklyArtistChart.js @@ -3,11 +3,14 @@ const chartData = require('./json/weekly-artist-charts.json') module.exports = async function () { const artists = chartData['weeklyartistchart']['artist'].splice(0, 8) const date = parseInt(chartData['weeklyartistchart']['@attr']['to']) * 1000 - let content = 'My top artists for the week:\n' - artists.forEach((artist) => { - content += `#${artist['@attr']['rank']} ${artist['name']}: ${artist['playcount']} plays\n` + let content = 'My top artists for the week: ' + artists.forEach((artist, index) => { + content += `${artist['name']} @ ${artist['playcount']} play${ + parseInt(artist['playcount']) > 1 ? 's' : '' + }` + if (index !== artists.length - 1) content += ', ' }) - content += '#Music #LastFM' + content += ' #Music #LastFM' return [ { title: content,