chore: readwise -> pinboard etc
This commit is contained in:
parent
ada4e21a71
commit
58da474ee0
8 changed files with 30 additions and 30 deletions
|
@ -1,15 +1,15 @@
|
|||
const EleventyFetch = require('@11ty/eleventy-fetch')
|
||||
|
||||
module.exports = async function () {
|
||||
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 PINBOARD_KEY = process.env.API_KEY_PINBOARD
|
||||
const url = `https://api.pinboard.in/v1/posts/recent?auth_token=${PINBOARD_KEY}&count=100&format=json`
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '1h',
|
||||
type: 'json',
|
||||
fetchOptions: { headers },
|
||||
}).catch()
|
||||
const feed = await res
|
||||
const filtered = feed.results.filter((item) => Object.keys(item.tags).includes('shortlist'))
|
||||
const filtered = feed.posts.filter((item) => {
|
||||
return item.shared === 'yes' && item.tags.includes('share')
|
||||
})
|
||||
return filtered.splice(0, 5)
|
||||
}
|
||||
|
|
Reference in a new issue