Skip to content

Instantly share code, notes, and snippets.

View Lprog2000's full-sized avatar

Lprog2000 Lprog2000

View GitHub Profile
@Lprog2000
Lprog2000 / update-v22.sh
Created April 29, 2026 13:20
selfie update v2.2
#!/bin/bash
# Обновление selfie-schedule до v2.2 (UU Суперметалл fix + service-first config)
set -e
echo ">>> Backup yclients-widget.js / parser.js / config.json"
cp /opt/selfie-schedule/yclients-widget.js /opt/selfie-schedule/yclients-widget.js.bak
cp /opt/selfie-schedule/parser.js /opt/selfie-schedule/parser.js.bak
cp /opt/selfie-schedule/config.json /opt/selfie-schedule/config.json.bak
echo ">>> Скачивание новых файлов"
curl -sSL "https://gist.githubusercontent.com/Lprog2000/ee3f1bf3864b24542159123d85de1149/raw/yclients-widget.js" > /opt/selfie-schedule/yclients-widget.js
@Lprog2000
Lprog2000 / config.json
Created April 29, 2026 13:19
selfie config v2.2
{
"competitors": [
{
"name": "Интроверт",
"provider": "yclients",
"formId": 1023104,
"companyId": 948858,
"locations": [
{
"name": "Флакон",
@Lprog2000
Lprog2000 / parser.js
Created April 29, 2026 13:19
selfie parser v2.2 (UU 404 fix)
#!/usr/bin/env node
/**
* Парсер расписания селфи-студий Москвы
* Провайдеры: YClients, Dikidi, UU, СЕЛФКЛИК
* Запуск: node parser.js [--date YYYY-MM-DD]
*/
const fs = require('fs');
const path = require('path');
const https = require('https');
@Lprog2000
Lprog2000 / update-and-test.sh
Created April 29, 2026 10:03
selfie update widget + run test
#!/bin/bash
# Обновить yclients-widget.js v2.1 (full chromium fallback) и прогнать парсер
set -e
echo ">>> Обновление yclients-widget.js"
curl -sSL https://is.gd/t8wUsY > /opt/selfie-schedule/yclients-widget.js
echo ">>> Размер: $(wc -c < /opt/selfie-schedule/yclients-widget.js) bytes"
echo ">>> Запуск парсера"
cd /opt/selfie-schedule
bash run.sh 2>&1 | tail -80
echo ">>> Готово. Сводка ушла в Telegram если YClients ожили."
@Lprog2000
Lprog2000 / yclients-widget.js
Last active April 29, 2026 13:19
selfie-schedule yclients-widget v2.1 (full chromium fallback)
/**
* YClients widget parser
* Открывает виджет одной студии (n{formId}.yclients.com), перехватывает headers
* из первого Angular-запроса (включая x-app-client-context от WASM signer),
* затем для каждого зала (staff_id) POST'ит search-timeslots с этими headers.
*
* Требует: playwright, headless Chromium.
*/
const { chromium } = require('playwright');
const fs = require('fs');