From 5591d9a334e3f11082eaf5fd2b7ef4f0ea5ae1d0 Mon Sep 17 00:00:00 2001 From: "Michael (GP)" Date: Mon, 12 Dec 2022 13:04:59 -0500 Subject: [PATCH] updating image path --- bot.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.js b/bot.js index 67813d5..aed7803 100644 --- a/bot.js +++ b/bot.js @@ -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", {