updating image path

This commit is contained in:
Michael (GP) 2022-12-12 13:04:59 -05:00
parent 67b65b4555
commit 5591d9a334

6
bot.js
View File

@ -2,6 +2,7 @@ if (process.env.NODE_ENV !== "production") {
require("dotenv").config();
}
var fs = require("fs");
const Path = require("path");
const axios = require("axios");
const urlMetadata = require("url-metadata");
let Mastodon = require("mastodon-api");
@ -62,10 +63,11 @@ async function postFeed() {
let metadata = await urlMetadata(item.link);
// Download feed item image
await download_image(metadata.image, "post-image");
let path = Path.resolve(__dirname, "images", "post-image");
await download_image(metadata.image, path);
let mediaup = await M.post("media", {
file: fs.createReadStream(item.guid),
file: fs.createReadStream(path),
});
await M.post("statuses", {