diff --git a/routes/_utils/mastodon.js b/routes/_utils/mastodon.js index e70a82b..880c3ed 100644 --- a/routes/_utils/mastodon.js +++ b/routes/_utils/mastodon.js @@ -48,4 +48,15 @@ export function getAccessTokenFromAuthCode(instanceName, clientId, clientSecret, code: code }) }) +} + +export function getHomeTimeline(instanceName, accessToken) { + let url = `https://${instanceName}/api/v1/timelines/home` + return fetch(url, { + method: 'GET', + headers: { + 'Accept': 'application/json', + 'Authorization': `Bearer ${accessToken}` + } + }) } \ No newline at end of file diff --git a/routes/index.html b/routes/index.html index 517058d..d3266a6 100644 --- a/routes/index.html +++ b/routes/index.html @@ -15,13 +15,29 @@