semaphore/routes/_utils/mastodon/timelines.js

20 lines
398 B
JavaScript
Raw Normal View History

2018-01-19 04:25:34 +00:00
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}`
})
}