From 589493ae693cab915366081cb0e19eecf304840b Mon Sep 17 00:00:00 2001 From: Anatoly Kopyl Date: Mon, 31 Aug 2020 16:07:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=BE=D0=BA=D0=B5=D0=BD=20=D0=B2=20.env?= =?UTF-8?q?=20=D0=B8=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BB=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 5 +++-- server/index.js | 10 ++++++---- style.css | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 style.css diff --git a/index.html b/index.html index 4e7769f..8e780f9 100644 --- a/index.html +++ b/index.html @@ -4,9 +4,10 @@ Статус - + + - Обнови мой эмодзи статус! + Обнови мой эмодзи статус! \ No newline at end of file diff --git a/server/index.js b/server/index.js index e601ecf..15810cd 100644 --- a/server/index.js +++ b/server/index.js @@ -8,16 +8,18 @@ import { httpsReq } from "./httpsReq.js"; dotenv.config(); const app = Express(); +const port = process.env.PORT || 5001; -const port = process.env.PORT || 5000; +const statusIds = [1, 2, 3, 4, 5, 9, 10, 17, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 38, 39]; app.use(Cors()); app.get('/update', (req, res) => { - let id = Math.floor(Math.random() * 34); - let url = `https://api.vk.com/method/users.setCovidStatus?access_token=1f3a7a0c80ba9d1e4af5b3e9ac583c98aa6d036be89c2508f4486913b1cbdb125a9a8c4440b6dbb57f348&status_id=${id}&v=5.103`; + var id = statusIds[Math.floor(Math.random() * statusIds.length)]; + let url = `https://api.vk.com/method/users.setCovidStatus?access_token=${process.env.TOKEN}&status_id=${id}&v=5.103`; httpsReq(url).then(() => { - res.send(); + console.log(response); + res.redirect("https://status.anatolykopyl.ru"); }); }); diff --git a/style.css b/style.css new file mode 100644 index 0000000..35ead8a --- /dev/null +++ b/style.css @@ -0,0 +1,20 @@ +* { + font-family: 'Russo One', sans-serif; + color: lightgray; + background-color: #597da3; +} + +body { + height: 100%; + text-align: center; + margin-top: 20%; +} + +a { + text-decoration: none; + font-size: xx-large; +} + +a:hover { + color: white; +} \ No newline at end of file