chore: matter -> reader
This commit is contained in:
parent
d2c5d9a8c1
commit
156b0ff9e3
4 changed files with 15 additions and 12 deletions
2
.env
2
.env
|
@ -1,7 +1,7 @@
|
|||
API_KEY_PLAUSIBLE=
|
||||
API_KEY_TRAKT=
|
||||
API_KEY_WEBMENTIONS_CORYD_DEV=
|
||||
API_TOKEN_MATTER=
|
||||
API_TOKEN_READWISE=
|
||||
API_BEARER_APPLE_MUSIC=
|
||||
API_TOKEN_APPLE_MUSIC=
|
||||
APPLE_RENEW_TOKEN_URL=
|
||||
|
|
|
@ -1,20 +1,23 @@
|
|||
const EleventyFetch = require('@11ty/eleventy-fetch')
|
||||
|
||||
module.exports = async function () {
|
||||
const MATTER_TOKEN = process.env.API_TOKEN_MATTER
|
||||
const headers = { Authorization: `Bearer ${MATTER_TOKEN}` }
|
||||
const url = `https://web.getmatter.com/api/library_items/favorites_feed`
|
||||
const READWISE_TOKEN = process.env.API_TOKEN_READWISE
|
||||
const headers = { Authorization: `Token ${READWISE_TOKEN}` }
|
||||
const url = 'https://readwise.io/api/v3/list?category=article'
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '1h',
|
||||
type: 'json',
|
||||
fetchOptions: { headers },
|
||||
})
|
||||
const favorites = await res
|
||||
return favorites.feed.splice(0, 5).map(link => {
|
||||
const data = await res
|
||||
const links = data.results.filter((result) => Object.keys(result.tags).includes('share'))
|
||||
return links.splice(0, 5).map((link) => {
|
||||
return {
|
||||
title: link.content.title,
|
||||
url: link.content.url,
|
||||
time: link.content['publication_date']
|
||||
title: link['title'],
|
||||
url: link['source_url'],
|
||||
time: link['published_date'],
|
||||
summary: link['summary'],
|
||||
id: link['id'],
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -9,10 +9,10 @@ permalink: '/links.json'
|
|||
"feed_url": "https://coryd.dev/links.json",
|
||||
"items": [{% for link in links %}
|
||||
{
|
||||
"id": "{{ link.link }}",
|
||||
"id": "{{ link.id }}",
|
||||
"title": "{{ link.title | escape }}",
|
||||
"url": "{{ link.url }}",
|
||||
"content_text": "",
|
||||
"content_text": "{{ link.summary | escape }}",
|
||||
"date_published": "{{ link.time | date: "%Y-%m-%dT%H:%M:%S-08:00" }}"
|
||||
}{% if not forloop.last %},{% endif %}
|
||||
{% endfor %}
|
||||
|
|
|
@ -79,7 +79,7 @@ Software and services that I use for work and my own enjoyment.
|
|||
- [1Password](https://1password.com)
|
||||
- [Trakt](https://trakt.tv)
|
||||
- [Letterboxd](https://letterboxd.com)
|
||||
- [Matter](https://getmatter.com)
|
||||
- [Reader](https://readwise.io/read)
|
||||
- [Whereby](https://whereby.com)
|
||||
- [Slack](http://slack.com)
|
||||
- [Discord](http://discord.com)
|
||||
|
|
Reference in a new issue