diff --git a/.env b/.env index bc39b647..357bd97c 100644 --- a/.env +++ b/.env @@ -1,9 +1,8 @@ API_KEY_PLAUSIBLE= API_KEY_TRAKT= API_KEY_WEBMENTIONS_CORYD_DEV= +API_TOKEN_MATTER= API_BEARER_APPLE_MUSIC= API_TOKEN_APPLE_MUSIC= APPLE_RENEW_TOKEN_URL= -CONSUMER_KEY_POCKET= -ACCESS_TOKEN_POCKET= SECRET_FEED_ALBUM_RELEASES= \ No newline at end of file diff --git a/src/_data/links.js b/src/_data/links.js index 10e26a59..0ecfd9fb 100644 --- a/src/_data/links.js +++ b/src/_data/links.js @@ -1,31 +1,20 @@ const EleventyFetch = require('@11ty/eleventy-fetch') module.exports = async function () { - const KEY = process.env.CONSUMER_KEY_POCKET - const TOKEN = process.env.ACCESS_TOKEN_POCKET - const url = 'https://getpocket.com/v3/get' + 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 res = EleventyFetch(url, { duration: '1h', type: 'json', - fetchOptions: { - method: 'POST', - body: JSON.stringify({ - 'consumer_key': KEY, - 'access_token': TOKEN, - 'favorite': 1, - }), - headers: { - 'Content-Type': 'application/json', - }, - }, - }).catch() - const data = await res - const articles = Object.values(data.list).map(article => { + fetchOptions: { headers }, + }) + const feed = await res + const links = feed.feed.splice(0, 5).map(link => { return { - title: article['resolved_title'], - url: article['resolved_url'], - time: article['time_added'] + title: link.content.title, + url: link.content.url } }) - return articles.sort((a, b) => b.time - a.time).splice(0, 5) + return links } diff --git a/src/_includes/now.liquid b/src/_includes/now.liquid index aebb6139..930cf604 100644 --- a/src/_includes/now.liquid +++ b/src/_includes/now.liquid @@ -119,6 +119,7 @@ layout: main