chore: use readwise for links
This commit is contained in:
parent
440e7694a9
commit
33d12238e9
6 changed files with 19 additions and 19 deletions
|
@ -1,14 +1,15 @@
|
|||
const EleventyFetch = require('@11ty/eleventy-fetch')
|
||||
|
||||
module.exports = async function () {
|
||||
const MATTER_TOKEN = process.env.ACCESS_TOKEN_MATTER
|
||||
const headers = { Authorization: `Bearer ${MATTER_TOKEN}` }
|
||||
const url = `https://web.getmatter.com/api/library_items/favorites_feed`
|
||||
const READWISE_KEY = process.env.API_KEY_READWISE
|
||||
const headers = { Authorization: `Token ${READWISE_KEY}` }
|
||||
const url = `https://readwise.io/api/v3/list/?category=article`
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '1h',
|
||||
type: 'json',
|
||||
fetchOptions: { headers },
|
||||
}).catch()
|
||||
const feed = await res
|
||||
return feed.feed.splice(0, 5)
|
||||
const filtered = feed.results.filter((item) => Object.keys(item.tags).includes('shortlist'))
|
||||
return filtered.splice(0, 5)
|
||||
}
|
||||
|
|
Reference in a new issue