cleanup + now topper
This commit is contained in:
parent
6c81b89874
commit
82604bd42b
38 changed files with 123 additions and 8 deletions
15
src/_data/nowplaying.js
Normal file
15
src/_data/nowplaying.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const EleventyFetch = require('@11ty/eleventy-fetch')
|
||||
|
||||
module.exports = async function () {
|
||||
const url = 'https://coryd.dev/api/music?limit=1&period=7day'
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '10m',
|
||||
type: 'json',
|
||||
})
|
||||
const music = await res
|
||||
return {
|
||||
artist: music.recenttracks.track[0].artist['#text'],
|
||||
title: music.recenttracks.track[0].name,
|
||||
url: music.recenttracks.track[0].url,
|
||||
}
|
||||
}
|
11
src/_data/status.js
Normal file
11
src/_data/status.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
const EleventyFetch = require('@11ty/eleventy-fetch')
|
||||
|
||||
module.exports = async function () {
|
||||
const url = 'https://api.omg.lol/address/cory/statuses/'
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '1d',
|
||||
type: 'json',
|
||||
})
|
||||
const status = await res
|
||||
return status.response.statuses[0]
|
||||
}
|
Reference in a new issue