m
This commit is contained in:
parent
bd3f8090ff
commit
8b0ed2c36f
1 changed files with 4 additions and 3 deletions
7
bot.js
7
bot.js
|
@ -1,10 +1,10 @@
|
||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
import pkg from 'express';
|
import pkg from 'express';
|
||||||
const { Express } = pkg;
|
const { Express } = pkg;
|
||||||
|
|
||||||
import { login } from 'masto';
|
import { login } from 'masto';
|
||||||
|
import * as fspkg from 'fs';
|
||||||
|
const { fs } = fspkg;
|
||||||
|
|
||||||
const masto = await login({
|
const masto = await login({
|
||||||
url: process.env.URL,
|
url: process.env.URL,
|
||||||
|
@ -18,10 +18,11 @@ const M = await masto.v1.statuses.create ({
|
||||||
visibility: 'public',
|
visibility: 'public',
|
||||||
});
|
});
|
||||||
|
|
||||||
M.post('statuses', params, (error, data) => {
|
M.post('statuses', (error, data) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
|
fs.writeFileSync('data.json', JSON.stringify(data, null, 2));
|
||||||
console.log(data);
|
console.log(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue