From ef94f64d212d7a086b27f9b6b7322697e04e1b82 Mon Sep 17 00:00:00 2001 From: Anatoly Kopyl Date: Tue, 19 Jan 2021 02:29:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=80=D0=B0=D1=81=D0=BF=D0=BE=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=82=D0=BE=D0=BA=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index 5c8bbe6..580562f 100644 --- a/server/index.js +++ b/server/index.js @@ -11,13 +11,20 @@ const app = Express(); const port = process.env.PORT || 5001; //const statusIds = [1, 2, 3, 4, 5, 9, 10, 17, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 38, 39]; -const statusIds = [114, 115, 116, 117, 118, 119, 120, 121]; +const statusIds = [114, 115, 116, 117, 118, 119, 120, 121]; //MLP статусы app.use(Cors()); app.get('/update', (req, res) => { var id = statusIds[Math.floor(Math.random() * statusIds.length)]; - let url = `https://api.vk.com/method/status.setImage?access_token=${process.env.TOKEN}&status_id=${id}&v=5.103`; + let token; + fs.readFile('../get-vk-token/token.txt', 'utf8', function(error, data) { + if (error) { + console.log(error); + } + token = data; + }); + let url = `https://api.vk.com/method/status.setImage?access_token=${token}&status_id=${id}&v=5.103`; httpsReq(url).then((response) => { console.log(response); //res.redirect("https://status.anatolykopyl.ru");