УМННБJ, ЯХВ. Войти !bnw Сегодня Клубы
#!/usr/bin/emacs --script

(require 'dom)

(defun corona ()
  (with-current-buffer (url-retrieve-synchronously "https://www.worldometers.info/coronavirus/" t)
    (goto-char url-http-end-of-headers)
    (setq cur-dom (libxml-parse-html-region (point) (point-max)))
    (setq texts (dom-texts cur-dom))
    (string-match "Coronavirus Cases: +\\([0-9,]+\\)" texts)
    (setq cases (match-string 1 texts))
    (string-match "Deaths: +\\([0-9,]+\\)" texts)
    (setq deaths (match-string 1 texts))
    (princ (format "%s / %s" deaths cases))))

(corona)
#G1JVOW / @ninesigns / 1725 дней назад

Оформи как corona-mode и чтоб в статусбаре жило, будет заебца.
#G1JVOW/ALT / @anonymous / 1725 дней назад

@anonymous ```

(require 'dom)

(setq corona-stats "")

(defun corona-get-stats ()
(with-current-buffer (url-retrieve-synchronously "https://www.worldometers.info/coronavirus/" t)
(goto-char url-http-end-of-headers)
(setq cur-dom (libxml-parse-html-region (point) (point-max)))
(setq texts (dom-texts cur-dom))
(string-match "Coronavirus Cases: +\([0-9,]+\)" texts)
(setq cases (match-string 1 texts))
(string-match "Deaths: +\([0-9,]+\)" texts)
(setq deaths (match-string 1 texts))
(format "👑 %s / %s" deaths cases)))

(define-minor-mode corona-mode
"Show coronavirus stats in modeline"
:global t
:lighter " 👑"
(add-to-list 'mode-line-misc-info `(corona-mode (:eval corona-stats)))
(run-with-idle-timer 0 (* 60 60) (lambda () (setq corona-stats (corona-get-stats)))))

#G1JVOW/4O3 / @ninesigns --> #G1JVOW/ALT / 1725 дней назад
@ninesigns ле //после включения емакс начинает лютейше тормозить и жрать проц
#G1JVOW/O76 / @anonymous --> #G1JVOW/4O3 / 1725 дней назад

@anonymous попробуй s/run-with-idle-timer/run-with-timer

#G1JVOW/V3N / @ninesigns --> #G1JVOW/O76 / 1725 дней назад
@ninesigns вот теперь норм
#G1JVOW/3RV / @anonymous --> #G1JVOW/V3N / 1725 дней назад
ipv6 ready BnW для ведрофона BnW на Реформале Викивач Котятки

Цоперайт © 2010-2016 @stiletto.