-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2214 from h3poteto/fix/pleroma-read-endpoint
Fix API response of pleroma read notifications
- Loading branch information
Showing
8 changed files
with
44 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as readline from 'readline' | ||
import generator, { Entity, Response } from 'megalodon' | ||
|
||
const rl: readline.ReadLine = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}) | ||
|
||
const BASE_URL: string = 'https://pleroma.io' | ||
|
||
const access_token: string = process.env.PLEROMA_ACCESS_TOKEN as string | ||
|
||
const client = generator('pleroma', BASE_URL, access_token) | ||
|
||
new Promise(resolve => { | ||
rl.question('Max notification ID: ', max_id => { | ||
client | ||
.readNotifications({ max_id: max_id }) | ||
.then(res => { | ||
console.log(res) | ||
rl.close() | ||
client.getMarkers(['home', 'notifications']).then((res: Response<Entity.Marker | Record<never, never>>) => { | ||
console.log(res.data) | ||
}) | ||
|
||
resolve(res) | ||
}) | ||
.catch(err => { | ||
console.error(err) | ||
rl.close() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters