diff --git a/routes/_utils/mastodon.js b/routes/_utils/mastodon.js index e70a82b8..880c3ede 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 517058d0..d3266a6c 100644 --- a/routes/index.html +++ b/routes/index.html @@ -15,13 +15,29 @@