WIP: show timeline with megalodon

This commit is contained in:
Cutls
2019-04-24 01:07:20 +09:00
parent 6adb1ce6d7
commit 4f2da222a1
5 changed files with 198 additions and 122 deletions

20
src/main/Timeline.ts Normal file
View File

@@ -0,0 +1,20 @@
import {
ipcMain
} from 'electron'
import Mastodon, { Status, Response } from 'megalodon'
//この書き方がいいのかは知りません。(cutls|background.ts)
export default class Timeline {
static timelineReady() {
ipcMain.on('no-auth-streaming', (event: Event, instance :String) => {
const client = new Mastodon(
"",
"https://"+instance + '/api/v1'
)
client.get<[Status]>('/timelines/public?local=true')
.then((resp: Response<[Status]>) => {
console.log(resp.data)
})
})
}
}