pinafore/routes/_utils/mastodon/timelines.js
2018-01-18 20:25:34 -08:00

20 lines
398 B
JavaScript

import { get, paramsString } from '../ajax'
export function getHomeTimeline(instanceName, accessToken, maxId, since) {
let url = `https://${instanceName}/api/v1/timelines/home`
let params = {}
if (since) {
params.since = since
}
if (maxId) {
params.max_id = maxId
}
url += '?' + paramsString(params)
return get(url, {
'Authorization': `Bearer ${accessToken}`
})
}