Токен в .env и новый стиль

This commit is contained in:
2020-08-31 16:07:50 +03:00
parent ff1d8db3e0
commit 589493ae69
3 changed files with 29 additions and 6 deletions

View File

@@ -4,9 +4,10 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Статус</title> <title>Статус</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <link href="https://fonts.googleapis.com/css2?family=Russo+One&display=swap" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head> </head>
<body> <body>
<a class='btn btn-primary' href="status.anatolykopyl.ru/status">Обнови мой эмодзи статус!</a> <a href="status.anatolykopyl.ru/status">Обнови мой эмодзи статус!</a>
</body> </body>
</html> </html>

View File

@@ -8,16 +8,18 @@ import { httpsReq } from "./httpsReq.js";
dotenv.config(); dotenv.config();
const app = Express(); 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.use(Cors());
app.get('/update', (req, res) => { app.get('/update', (req, res) => {
let id = Math.floor(Math.random() * 34); var id = statusIds[Math.floor(Math.random() * statusIds.length)];
let url = `https://api.vk.com/method/users.setCovidStatus?access_token=1f3a7a0c80ba9d1e4af5b3e9ac583c98aa6d036be89c2508f4486913b1cbdb125a9a8c4440b6dbb57f348&status_id=${id}&v=5.103`; let url = `https://api.vk.com/method/users.setCovidStatus?access_token=${process.env.TOKEN}&status_id=${id}&v=5.103`;
httpsReq(url).then(() => { httpsReq(url).then(() => {
res.send(); console.log(response);
res.redirect("https://status.anatolykopyl.ru");
}); });
}); });

20
style.css Normal file
View File

@@ -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;
}