offload now calls + generation to 11ty; add activity feed; cleanup

This commit is contained in:
Cory Dransfeldt 2023-03-16 13:25:57 -07:00
parent 4bd059bc90
commit 4dd6cc9313
No known key found for this signature in database
18 changed files with 192 additions and 93 deletions

12
src/_data/artists.js Normal file
View file

@ -0,0 +1,12 @@
const EleventyFetch = require('@11ty/eleventy-fetch')
module.exports = async function () {
const MUSIC_KEY = process.env.API_KEY_LASTFM
const url = `http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=cdme_&api_key=${MUSIC_KEY}&limit=8&format=json&period=7day`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
})
const artists = await res
return artists.topartists.artist
}