chore: standardize formatting

This commit is contained in:
Cory Dransfeldt 2023-03-25 12:53:13 -07:00
parent e94e5a523c
commit a0d064be6a
No known key found for this signature in database
58 changed files with 971 additions and 1673 deletions

View file

@ -1,12 +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.gettopalbums&user=cdme_&api_key=${MUSIC_KEY}&limit=8&format=json&period=7day`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
})
const albums = await res
return albums.topalbums.album
const MUSIC_KEY = process.env.API_KEY_LASTFM
const url = `http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=cdme_&api_key=${MUSIC_KEY}&limit=8&format=json&period=7day`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
})
const albums = await res
return albums.topalbums.album
}

View file

@ -1,12 +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
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
}

View file

@ -2,11 +2,13 @@ const { extract } = require('@extractus/feed-extractor')
const { AssetCache } = require('@11ty/eleventy-fetch')
module.exports = async function () {
const url = 'https://oku.club/rss/collection/POaRa'
const asset = new AssetCache('books_data')
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
const res = await extract(url).catch((error) => {})
const data = res.entries
await asset.save(data, 'json')
return data
const url = 'https://oku.club/rss/collection/POaRa'
const asset = new AssetCache('books_data')
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
const res = await extract(url).catch((error) => {
console.log(error.message)
})
const data = res.entries
await asset.save(data, 'json')
return data
}

View file

@ -2,11 +2,13 @@ const { extract } = require('@extractus/feed-extractor')
const { AssetCache } = require('@11ty/eleventy-fetch')
module.exports = async function () {
const url = 'https://letterboxd.com/cdme/rss'
const asset = new AssetCache('movies_data')
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
const res = await extract(url).catch((error) => {})
const data = res.entries.splice(0, 5)
await asset.save(data, 'json')
return data
const url = 'https://letterboxd.com/cdme/rss'
const asset = new AssetCache('movies_data')
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
const res = await extract(url).catch((error) => {
console.log(error.message)
})
const data = res.entries.splice(0, 5)
await asset.save(data, 'json')
return data
}

View file

@ -1,16 +1,16 @@
{
"name": "Cory Dransfeldt",
"url": "https://coryd.dev",
"title": "Cory Dransfeldt",
"description": "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies.",
"gmail": "mailto:hi@coryd.dev",
"savvycal": "https://savvycal.com/coryd",
"github": "https://github.com/cdransf",
"mastodon": "https://social.lol/@cory",
"glass": "https://glass.photo/coryd",
"lastfm": "https://last.fm/user/cdme_",
"letterboxd": "https://letterboxd.com/cdme",
"trakt": "https://trakt.tv/users/cdransf",
"oku": "https://oku.club/user/cory",
"coffee": "https://www.buymeacoffee.com/cory"
"name": "Cory Dransfeldt",
"url": "https://coryd.dev",
"title": "Cory Dransfeldt",
"description": "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies.",
"gmail": "mailto:hi@coryd.dev",
"savvycal": "https://savvycal.com/coryd",
"github": "https://github.com/cdransf",
"mastodon": "https://social.lol/@cory",
"glass": "https://glass.photo/coryd",
"lastfm": "https://last.fm/user/cdme_",
"letterboxd": "https://letterboxd.com/cdme",
"trakt": "https://trakt.tv/users/cdransf",
"oku": "https://oku.club/user/cory",
"coffee": "https://www.buymeacoffee.com/cory"
}

View file

@ -1,11 +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: '1h',
type: 'json',
})
const status = await res
return status.response.statuses[0]
const url = 'https://api.omg.lol/address/cory/statuses/'
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
})
const status = await res
return status.response.statuses[0]
}

View file

@ -2,12 +2,14 @@ const { extract } = require('@extractus/feed-extractor')
const { AssetCache } = require('@11ty/eleventy-fetch')
module.exports = async function () {
const TV_KEY = process.env.API_KEY_TRAKT
const url = `https://trakt.tv/users/cdransf/history.atom?slurm=${TV_KEY}`
const asset = new AssetCache('tv_data')
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
const res = await extract(url).catch((error) => {})
const data = res.entries.splice(0, 5)
await asset.save(data, 'json')
return data
const TV_KEY = process.env.API_KEY_TRAKT
const url = `https://trakt.tv/users/cdransf/history.atom?slurm=${TV_KEY}`
const asset = new AssetCache('tv_data')
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
const res = await extract(url).catch((error) => {
console.log(error.message)
})
const data = res.entries.splice(0, 5)
await asset.save(data, 'json')
return data
}

View file

@ -1,14 +1,14 @@
const EleventyFetch = require('@11ty/eleventy-fetch')
module.exports = async function () {
const KEY_CORYD = process.env.API_KEY_WEBMENTIONS_CORYD_DEV
const url = `https://webmention.io/api/mentions.jf2?token=${KEY_CORYD}&per-page=1000`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
})
const webmentions = await res
return {
mentions: webmentions.children,
}
const KEY_CORYD = process.env.API_KEY_WEBMENTIONS_CORYD_DEV
const url = `https://webmention.io/api/mentions.jf2?token=${KEY_CORYD}&per-page=1000`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
})
const webmentions = await res
return {
mentions: webmentions.children,
}
}