Изменил расположение токена

This commit is contained in:
2021-01-19 02:29:30 +03:00
parent 82e145c5c0
commit ef94f64d21

View File

@@ -11,13 +11,20 @@ const app = Express();
const port = process.env.PORT || 5001; 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 = [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.use(Cors());
app.get('/update', (req, res) => { app.get('/update', (req, res) => {
var id = statusIds[Math.floor(Math.random() * statusIds.length)]; 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) => { httpsReq(url).then((response) => {
console.log(response); console.log(response);
//res.redirect("https://status.anatolykopyl.ru"); //res.redirect("https://status.anatolykopyl.ru");