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.

37 lines
829 B

import * as dotenv from 'dotenv';
dotenv.config();
import pkg from 'express';
const { Express } = pkg;
import { login } from 'masto';
1 year ago
import * as fspkg from 'fs';
const { fs } = fspkg;
const masto = await login({
url: process.env.URL,
accessToken: process.env.ACCESS_TOKEN,
});
console.log("selfcarebot starting...");
1 year ago
const data1 = fspkg.readFile('dataset1.json', 'utf8', (error, data) => {
if (error){
console.log(error);
return;
}
console.log(JSON.parse(data));
})
const status = await masto.v1.statuses.create ({
status: `${data1} selfcare! 🌸`,
visibility: 'public',
});
1 year ago
console.log('masto.v1.statuses', 'utf8', (error, data) => {
if (error) {
console.error(error);
} else {
1 year ago
fspkg.writeFileSync(data.json);
console.log(data);
}
}
);