chore: update uses

This commit is contained in:
Cory Dransfeldt 2023-09-07 16:07:33 -07:00
parent aa5fd1bb0f
commit 98708877b8
No known key found for this signature in database
6 changed files with 22 additions and 432 deletions

View file

@ -1,26 +1,26 @@
const EleventyFetch = require('@11ty/eleventy-fetch')
module.exports = async function () {
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 MATTER_TOKEN = process.env.ACCESS_TOKEN_MATTER
const headers = { Cookie: MATTER_TOKEN }
const url = `https://web.getmatter.com/api/library_items/favorites_feed`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
fetchOptions: { headers },
})
const data = await res
const links = data['results'].filter((result) => Object.keys(result.tags).includes('share'))
return links.map((link) => {
const feed = await res
const articles = feed.feed
return articles.reverse().map((article) => {
return {
title: link['title'],
url: link['source_url'],
date: link['published_date']
? new Date(link['published_date'])
: new Date(link['created_at']),
summary: link['summary'],
notes: link['notes'],
id: btoa(link['source_url']),
url: article['content']['url'],
title: article['content']['title'],
date: article['content']['publication_date']
? new Date(article['content']['publication_date'])
: new Date(article['content']['feed_date']),
summary: article['content']['excerpt'],
notes: article['content']['my_notes'],
id: btoa(article['id']),
}
})
}

View file

@ -85,7 +85,7 @@ Software and services that I use for work and my own enjoyment.
- [Trakt](https://trakt.tv)
- [Letterboxd](https://letterboxd.com)
- [Goodreads](https://goodreads.com)
- [Reader](https://readwise.io/read)
- [Matter](https://getmatter.com)
- [Slack](http://slack.com)
- [Discord](http://discord.com)