Skip to content

Commit

Permalink
Update mastodon.js
Browse files Browse the repository at this point in the history
  • Loading branch information
8bitkick authored Jan 22, 2024
1 parent 10e2ce3 commit 1b1088f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mastodon.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ const config = {
const mastodon = new Mastodon(config);
const fs = require('fs');

function exec(cmd) {
const exec = require('child_process').exec;
return new Promise((resolve, reject) => {
exec(cmd, (error, stdout, stderr) => {
if (error) {
console.warn(error);
}
resolve(stdout? stdout.trim() : stderr);
});
});
}

function post(path, params) {
log.info("Post", path, params)
}
Expand Down Expand Up @@ -53,6 +65,8 @@ async function videoReply(filename, mediaType, replyTo, text, toot, checksum, ha
await mastodon.post('statuses/' + response.data.id + '/reblog');
}

exec('rm '+filename);

//return {full:"https://bbcmic.ro/"+experimental+"#"+progData,key:short_url}
}

Expand Down

0 comments on commit 1b1088f

Please sign in to comment.