You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
480 B
22 lines
480 B
1 year ago
|
import generator from "npm:megalodon@5.4.1";
|
||
|
|
||
|
const client = generator.default("pleroma", "https://social.ruthenic.com");
|
||
|
|
||
|
const appData = await client.registerApp("Test", {
|
||
|
scopes: ["read", "write", "follow"],
|
||
|
});
|
||
|
|
||
|
console.log(appData.url);
|
||
|
|
||
|
const code = prompt("Enter auth code:");
|
||
|
|
||
|
if (code) {
|
||
|
console.log(
|
||
|
await client.fetchAccessToken(
|
||
|
appData.clientId,
|
||
|
appData.clientSecret,
|
||
|
code,
|
||
|
),
|
||
|
);
|
||
|
}
|