offload now calls + generation to 11ty; add activity feed; cleanup
This commit is contained in:
parent
4bd059bc90
commit
4dd6cc9313
18 changed files with 192 additions and 93 deletions
12
src/_data/books.js
Normal file
12
src/_data/books.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
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
|
||||
}
|
Reference in a new issue