From 65aa56eee6bc5423569a605b08b66bdf8383e7c8 Mon Sep 17 00:00:00 2001 From: dx Date: Sat, 2 May 2020 07:17:34 +0100 Subject: +custom rss module When using the inbuilt RSS module, this becomes my personal config for that module. However, when not using that and instead using the newsticker inbuilt for Emacs, I've got a config for that as well. --- Doom/.doom.d/modules/private/rss/config.el | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Doom/.doom.d/modules/private/rss/config.el (limited to 'Doom/.doom.d/modules/private/rss/config.el') diff --git a/Doom/.doom.d/modules/private/rss/config.el b/Doom/.doom.d/modules/private/rss/config.el new file mode 100644 index 0000000..035c2d3 --- /dev/null +++ b/Doom/.doom.d/modules/private/rss/config.el @@ -0,0 +1,50 @@ +;;; private/rss/config.el -*- lexical-binding: t; -*- + +(require 'seq) +(require 'cl-lib) + +(defvar +rss/feed-urls '(("Arch Linux" "https://www.archlinux.org/feeds/news/" Linux) + ("LEMMiNO" "https://www.youtube.com/feeds/videos.xml?channel_id=UCRcgy6GzDeccI7dkbbBna3Q" YouTube) + ("Gamer from Mars" "https://www.youtube.com/feeds/videos.xml?channel_id=UCJ6z_yj_dDNrhn-c8ZyKV4g" YouTube) + ("Pop Culture Detective" "https://www.youtube.com/feeds/videos.xml?channel_id=UCHiwtz2tCEfS17N9A-WoSSw" YouTube) + ("Dark Sominium" "https://www.youtube.com/feeds/videos.xml?channel_id=UC_e39rWdkQqo5-LbiLiU10g" YouTube) + ("Nexpo" "https://www.youtube.com/feeds/videos.xml?channel_id=UCpFFItkfZz1qz5PpHpqzYBw" YouTube) + ("Techquickie" "https://www.youtube.com/feeds/videos.xml?channel_id=UC0vBXGSyV14uvJ4hECDOl0Q" YouTube) + ("3B1B" "https://www.youtube.com/feeds/videos.xml?channel_id=UCYO_jab_esuFRV4b17AJtAw" YouTube))) + + +(when (featurep! +elfeed) + (after! elfeed + (setq elfeed-feeds (cl-map 'list (lambda (item) (list (nth 1 item) (nth 2 item))) +rss/feed-urls)))) + +(when (featurep! +newsticker) + (defun +rss/set-feed-urls (LIST) + "Set the newsticker-url-list to LIST. LIST should have format =(TAG URL START_TIME INTERVAL)=" + (setq newsticker-url-list LIST)) + + (defun +rss/get-newsticker-buffers () + "Using seq, filter the buffer list for newsticker buffers" + (seq-remove (lambda (buffer) + (not (and (cl-search "*Newsticker" (buffer-name buffer)) + (= (cl-search "*Newsticker" (buffer-name buffer)))))) + (buffer-list))) + + (defun +rss/close-newsticker() + "Routine to close the newsticker system" + (interactive) + (newsticker-stop) + (dolist (buf (+rss/get-newsticker-buffers)) + (kill-buffer buf)) + (+workspace/delete "RSS")) + + (use-package! newsticker + :config + (+rss/set-feed-urls ; Format is =(TAG URL START_TIME INTERVAL)= + (cl-map 'list (lambda (item) (list (nth 0 item) (nth 1 item) nil 3600)) +rss/feed-urls)) + + (defun +rss/open-newsticker () + "Routine to start and open the newsticker" + (interactive) + (newsticker-start) + (+workspace/new "RSS") + (newsticker-treeview)))) -- cgit v1.2.3-13-gbd6f