feat: maybe
This commit is contained in:
parent
c13f78412b
commit
20444321ba
2 changed files with 32 additions and 0 deletions
19
src/_data/weeklyArtistChart.js
Normal file
19
src/_data/weeklyArtistChart.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
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`
|
||||
})
|
||||
content += '#Music #LastFM'
|
||||
return [
|
||||
{
|
||||
title: content,
|
||||
url: 'https://last.fm/user/coryd_',
|
||||
date: new Date(date),
|
||||
description: 'My top artists for the week as a feed item.',
|
||||
},
|
||||
]
|
||||
}
|
Reference in a new issue