diff --git a/.env b/.env index afc0c984..e52c2526 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ -API_KEY_LASTFM= API_KEY_TRAKT= API_KEY_MOVIEDB= API_KEY_WEBMENTIONS_CORYD_DEV= diff --git a/src/_data/albums.js b/src/_data/albums.js deleted file mode 100644 index af4db256..00000000 --- a/src/_data/albums.js +++ /dev/null @@ -1,32 +0,0 @@ -const EleventyFetch = require('@11ty/eleventy-fetch') -const ALBUM_DENYLIST = ['no-love-deep-web', 'unremittance'] - -module.exports = async function () { - const MUSIC_KEY = process.env.API_KEY_LASTFM - const url = `https://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=cdrn_&api_key=${MUSIC_KEY}&limit=8&format=json&period=7day` - const res = EleventyFetch(url, { - duration: '1h', - type: 'json', - }).catch() - const data = await res - return data['topalbums']['album'].map((album) => { - return { - title: album['name'], - artist: album['artist']['name'], - plays: album['playcount'], - rank: album['@attr']['rank'], - image: !ALBUM_DENYLIST.includes(album['name'].replace(/\s+/g, '-').toLowerCase()) - ? album['image'][album['image'].length - 1]['#text'].replace( - 'https://lastfm.freetls.fastly.net', - 'https://albums.coryd.dev' - ) - : `https://cdn.coryd.dev/albums/${album['name'].name - .replace(/\s+/g, '-') - .toLowerCase()}.jpg`, - url: album['mbid'] - ? `https://musicbrainz.org/album/${album['mbid']}` - : `https://musicbrainz.org/search?query=${encodeURI(album['name'])}&type=release_group`, - type: 'album', - } - }) -} diff --git a/src/_data/artists.js b/src/_data/artists.js deleted file mode 100644 index 926d1346..00000000 --- a/src/_data/artists.js +++ /dev/null @@ -1,25 +0,0 @@ -const EleventyFetch = require('@11ty/eleventy-fetch') - -module.exports = async function () { - const MUSIC_KEY = process.env.API_KEY_LASTFM - const url = `https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=cdrn_&api_key=${MUSIC_KEY}&limit=8&format=json&period=7day` - const res = EleventyFetch(url, { - duration: '1h', - type: 'json', - }).catch() - const data = await res - return data['topartists']['artist'].map((artist) => { - return { - title: artist['name'], - plays: artist['playcount'], - rank: artist['@attr']['rank'], - image: - `https://cdn.coryd.dev/artists/${artist['name'].replace(/\s+/g, '-').toLowerCase()}.jpg` || - 'https://cdn.coryd.dev/artists/missing-artist.jpg', - url: artist['mbid'] - ? `https://musicbrainz.org/artist/${artist['mbid']}` - : `https://musicbrainz.org/search?query=${encodeURI(artist['name'])}&type=artist`, - type: 'artist', - } - }) -}