mirror of
https://gitverse.ru/kpa39l/vesti.git
synced 2026-09-29 09:55:03 +00:00
feat(sources): форма добавления источника — одно поле Address, авто-название из TG/RSS (address-field-enhancement)
- parse_address(address, crawler) в sources/sources.py: telegram (t.me/name, @name, https://t.me/s/name) → slug/channel/url; rss → feed_url/url/slug из домена. - GET /sources/preview: telegram — название через Telethon get_entity (title), rss — через feedparser (feed.title); slug и name возвращаются в JSON. - _form_source: единое поле address вместо url/channel/feed_url; slug из адреса. - /sources: direction datalist из DIRECTIONS + уникальные значения из БД, свободный ввод остаётся. - Форма: поле Address + кнопка «Найти» (JS fetch → заполнение slug/name), direction datalist динамический. Также в sources.py входит незакоммиченная ранее веб-CRUD-логика (upsert_source_yaml, delete_source_yaml, sync_yaml_to_db_and_back и др.) — работала на проде, теперь в git.
This commit is contained in:
@@ -8,11 +8,11 @@ Direction — datalist из реальных значений БД + свобо
|
||||
|
||||
## Tasks
|
||||
|
||||
- [ ] sources/sources.py: `parse_address(address, crawler)` — telegram/rss парсинг адреса
|
||||
- [ ] web/app.py: route GET /sources/preview (Telethon get_entity / feedparser title)
|
||||
- [ ] web/app.py: _form_source — address вместо url/channel/feed_url; slug из address
|
||||
- [ ] web/app.py: /sources — DIRECTIONS + уникальные из БД → directions в контекст
|
||||
- [ ] web/templates/sources.html: одно поле address, кнопка «Найти» → slug/name; datalist direction из данных
|
||||
- [ ] openspec validate clean
|
||||
- [ ] рестарт vesti-web; curl preview (telegram+rss); ручная проверка формы
|
||||
- [ ] STATUS.md актуализирован; commit + push gitverse
|
||||
- [x] sources/sources.py: `parse_address(address, crawler)` — telegram/rss парсинг адреса
|
||||
- [x] web/app.py: route GET /sources/preview (Telethon get_entity / feedparser title)
|
||||
- [x] web/app.py: _form_source — address вместо url/channel/feed_url; slug из address
|
||||
- [x] web/app.py: /sources — DIRECTIONS + уникальные из БД → directions в контекст
|
||||
- [x] web/templates/sources.html: одно поле address, кнопка «Найти» → slug/name; datalist direction из данных
|
||||
- [x] openspec validate clean
|
||||
- [x] рестарт vesti-web; curl preview (telegram: mknewsru→«Мой Компьютер», linuxklub→«Linux Club»; rss: lwn→«LWN.net»)
|
||||
- [x] STATUS.md актуализирован; commit + push gitverse
|
||||
Reference in New Issue
Block a user