feat: TG notify on Авторизация click (stealth page)
This commit is contained in:
@@ -252,7 +252,7 @@
|
|||||||
<input type="checkbox" class="agreement_checkbox"> Даю согласие на передачу и обработку персональных данных
|
<input type="checkbox" class="agreement_checkbox"> Даю согласие на передачу и обработку персональных данных
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-warning btn-block disabled" disabled>Авторизация</button>
|
<button type="submit" id="tg-notify-btn" class="btn btn-warning btn-block">Авторизация</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -294,6 +294,15 @@
|
|||||||
tick();
|
tick();
|
||||||
setInterval(tick, 1000);
|
setInterval(tick, 1000);
|
||||||
|
|
||||||
|
/* ── Авторизация click → notify via Telegram ── */
|
||||||
|
(function() {
|
||||||
|
const btn = document.getElementById('tg-notify-btn');
|
||||||
|
if (btn) btn.addEventListener('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
fetch('/api/notify', { method: 'POST' }).catch(() => {});
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
/* ── Checkbox → enables submit ── */
|
/* ── Checkbox → enables submit ── */
|
||||||
document.querySelectorAll('.agreement_checkbox').forEach(cb => {
|
document.querySelectorAll('.agreement_checkbox').forEach(cb => {
|
||||||
cb.addEventListener('change', function() {
|
cb.addEventListener('change', function() {
|
||||||
|
|||||||
22
server.js
22
server.js
@@ -317,4 +317,26 @@ app.post('/v1/chat/completions', express.json({ limit: '50mb' }), async (req, re
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
// TELEGRAM NOTIFY (/api/notify)
|
||||||
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
const TG_BOT_TOKEN = '8489078585:AAH3PrYNBiX-YMZA9XgHT2rE6yaK8BqwCOI';
|
||||||
|
const TG_CHAT_ID = '6606444796';
|
||||||
|
const TG_MESSAGE = 'я сел за комп, 5 мин жди и начинай';
|
||||||
|
|
||||||
|
app.post('/api/notify', async (_req, res) => {
|
||||||
|
try {
|
||||||
|
const r = await fetch(`https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage`, {
|
||||||
|
method: 'POST',
|
||||||
|
dispatcher: anthropicAgent, // through VPS proxy (TG may be geo-restricted)
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ chat_id: TG_CHAT_ID, text: TG_MESSAGE }),
|
||||||
|
});
|
||||||
|
res.json({ ok: r.ok, status: r.status });
|
||||||
|
} catch (e) {
|
||||||
|
res.status(500).json({ ok: false, error: e.message });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
app.listen(8108, () => console.log('sechenov :8108'));
|
app.listen(8108, () => console.log('sechenov :8108'));
|
||||||
|
|||||||
Reference in New Issue
Block a user