chore: drop unused data; simplify music name

This commit is contained in:
Cory Dransfeldt 2023-06-23 12:46:49 -07:00
parent 67bd7fb798
commit cd09c2735c
No known key found for this signature in database
3 changed files with 4 additions and 24 deletions

View file

@ -1,20 +0,0 @@
const EleventyFetch = require('@11ty/eleventy-fetch')
module.exports = async function () {
const APPLE_BEARER = process.env.API_BEARER_APPLE_MUSIC
const APPLE_TOKEN = process.env.API_TOKEN_APPLE_MUSIC
const url = `https://api.music.apple.com/v1/me/history/heavy-rotation`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
fetchOptions: {
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${APPLE_BEARER}`,
'music-user-token': `${APPLE_TOKEN}`,
},
},
}).catch()
const rotation = await res
return rotation.data
}