elfeed.el 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. ;; -*- eval: (goto-address-mode 1); -*-
  2. ;; (require 'guix-ui-package) ;for guix-show-emacs-package-without-prefix
  3. (setq elfeed-feeds
  4. '(("https://oremacs.com/atom.xml" emacs)
  5. ("http://nullprogram.com/feed/" emacs)
  6. ("https://h-node.org/rss/modifications/en" hardware)
  7. ("https://lwn.net/headlines/newrss" linux)
  8. ("https://fedoramagazine.org/feed/" linux)
  9. ("https://www.47deg.com/feed.xml" programming)
  10. ("https://www.youtube.com/feeds/videos.xml?channel_id=UC_ehNByPcItZU3pXL-4skUA" video)
  11. ("https://twitchrss.appspot.com/vod/carolinhr" video)
  12. ("https://opensource.com/feed" news)
  13. ("https://news.ycombinator.com/rss" news)
  14. ("http://government.ru/all/rss/" gov ru)
  15. ("https://rublacklist.net/feed/" ru censor)
  16. ;; ("https://git.savannah.gnu.org/cgit/emacs.git/atom/?h=master" vc emacs)
  17. ;; ("https://git.savannah.gnu.org/cgit/guix.git/atom/?h=master" vc scheme guix)
  18. ("https://github.com/stumpwm/stumpwm-contrib/commits/master.atom" vc lisp stumpwm)
  19. ("https://github.com/stumpwm/stumpwm/commits/master.atom" vc lisp stumpwm)
  20. ("https://github.com/adelin-b/yawhich-key/commits/master.atom" vc bash)
  21. ("https://news-web.php.net/group.php?group=php.announce&format=rss" php)
  22. ("https://www.bennee.com/~alex/blog/feed/" emacs)
  23. ("https://libraries.io/search.atom?order=desc&platforms=Emacs&sort=created_at" emacs)
  24. ;; ("https://stable.melpa.org/updates.rss" emacs elpa)
  25. ("https://cestlaz.github.io/rss.xml" emacs)
  26. ("https://sachachua.com/blog/feed/" emacs)
  27. ("https://www.reddit.com/r/freegames/.rss" game freegames)
  28. ("https://www.reddit.com/r/selfhosted/.rss" reddit selfhosted)
  29. ("https://www.reddit.com/r/homelab/.rss" reddit homelab)
  30. ;; ("https://github.com/alebcay/awesome-shell/commits/master.atom" vc bash awesome)
  31. ;; ("https://github.com/awesome-selfhosted/awesome-selfhosted/commits/master.atom" vc awesome selfhosted)
  32. ;; ("https://github.com/CodyReichert/awesome-cl/commits/master.atom" vc awesome lisp)
  33. ;; ("https://github.com/sindresorhus/awesome/commits/main.atom" vc awesome)
  34. ("https://www.trackawesomelist.com/rss.xml" awesome)
  35. ("https://forum.level1techs.com/posts.rss" virtualization)
  36. ("https://microservices.io/feed.xml" microservices)
  37. ("https://archlinux.org/feeds/planet" planet)
  38. ("https://weekly.nixos.org/feeds/all.rss.xml" planet)
  39. ("http://www.scheme.dk/planet/atom.xml" planet)
  40. ("http://planet.gnu.org/atom.xml" planet)
  41. ("http://planet.lisp.org/rss20.xml" planet)
  42. ("https://planet.emacslife.com/atom.xml" planet)
  43. ("https://twitchrss.appspot.com/vod/artgameslp" game video)
  44. ("https://habr.com/ru/users/Gim6626/rss/posts/?fl=ru" news) ;FOSS News - дайджест новостей и других материалов о свободном и открытом ПО
  45. ("https://habr.com/rss/flows/admin/all" habr admin)
  46. ("https://habr.com/rss/hub/kubernetes/all" habr kubernetes)
  47. ("https://fluxcd.io/blog/index.xml" kubernetes fluxcd)
  48. ("https://habr.com/rss/flows/develop/all" habr programming)
  49. ("https://habr.com/rss/hub/network_hardware/all" habr networking hardware)
  50. ("https://habr.com/rss/hub/hardware/all" habr hardware)
  51. ("https://habr.com/rss/hub/open_source/all" habr programming)
  52. ("https://habr.com/rss/hub/linux_dev/all" habr programming linux)
  53. ("https://habr.com/rss/hub/sql/all" habr databases)
  54. ("https://habr.com/rss/hub/db_admins/all" habr databases)
  55. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCRb4fTtfgVtXbvjlqGDocDg" lisp video) ;Andrew Kravchuk - Darkness Looming: The Dawn
  56. ("https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA" video) ;Mental Outlaw
  57. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCq2QwnKW79w4a55ZQqOBReg" video) ;Irishluck Linux
  58. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCF3d6ZcTRBhnrNC0-cvzicw" video) ;Nitroxsenys
  59. ("https://www.youtube.com/feeds/videos.xml?channel_id=UC1RZz5_cdVQHhhYJVpCDqHA" video) ;Nitro Live
  60. ("https://www.youtube.com/feeds/videos.xml?user=elementaller" video)
  61. ("https://www.youtube.com/feeds/videos.xml?user=Pashtet495" video)
  62. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCOpm7EqPBtznEwYNNZrz1FQ" video) ;stalkash
  63. ("https://www.youtube.com/feeds/videos.xml?user=gotbletu" video)
  64. ("https://www.youtube.com/feeds/videos.xml?user=SsethTzeentach" video)
  65. ("https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA" video) ;Luke Smith
  66. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCld68syR8Wi-GY_n4CaoJGA" video) ;Brodie Robertson
  67. ("https://youtube.com/feeds/videos.xml?channel_id=UCfhSB16X9MXhzSFe_H7XbHg" video) ;Bryan Jenks
  68. ("https://www.youtube.com/feeds/videos.xml?user=metalx1000" video)
  69. ("https://bitlove.org/jupiterbroadcasting/bsdnowhd/feed" video)
  70. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg" video) ;DistroTube
  71. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCkK9UDm_ZNrq_rIXCz3xCGA" video) ;Bryan Lunduke
  72. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCbHXJGd7c8Hy4z0-YX1Jf3Q" video) ;WP Website Guide
  73. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCMV8p6Lb-bd6UZtTc_QD4zA" video) ;Baggers
  74. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCZrrEuHiQjN2CUo84g5tk7w" video) ;tripcode!Q/7
  75. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCgY050JAKtaew3IEgGW1qSQ" video) ;Unix way
  76. ("https://www.youtube.com/feeds/videos.xml?user=dubbeltumme" video)
  77. ("https://www.youtube.com/feeds/videos.xml?user=LDCNow" video)
  78. ("https://www.youtube.com/feeds/videos.xml?user=tuxreviews" video)
  79. ("https://www.youtube.com/feeds/videos.xml?channel_id=UC_hvS-IJ_SY04Op14v3l4Lg" video) ;Мир IT с Антоном Павленко
  80. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCgU5tUdVPpfM7sLAMWBTsDg" video) ;computeremotion.com
  81. ("https://www.youtube.com/feeds/videos.xml?channel_id=UC2Ik2vXvwJWp0GLBn7oRIQQ" video hardware) ;SpecList
  82. ("https://www.youtube.com/feeds/videos.xml?channel_id=UC-7I1gU1r6PxBSl87o-7YEQ" video hardware retro) ;Druaga1
  83. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCsGdWQMkl4Yv4fLBQ3aCC1Q" video linux) ;FLOSS Weekly
  84. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCoLGyLwOpcPYQIG1z185GYg" video peripheral) ;игроман
  85. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCD-S-2TMDY4fL-R5iDQn-6Q" video peripheral) ;PRO ДЕВАЙСЫ
  86. ("https://www.youtube.com/feeds/videos.xml?channel_id=UCKzBovyB_YU0oSM1eMcV_ow" video hardware) ;E-Katalog
  87. ("https://toot.aquilenet.fr/@civodul.rss" mastodon) ;Ludovic Courtès
  88. ("https://functional.cafe/@ioa.rss" mastodon) ;ioanna
  89. ("https://video.hardlimit.com/feeds/videos.xml?videoChannelId=39" video) ;The GNU Guy
  90. ;; ("https://www.pepper.ru/rss/%D0%92%D1%81%D0%B5" shopping)
  91. ("https://www.opennet.ru/opennews/opennews_all.rss" news)
  92. ;; ("https://ci.guix.gnu.org/events/rss/" ci guix)
  93. ("https://lk.sknt.ru/rss.php" internet)
  94. ("https://git.ispconfig.org/ispconfig/ispconfig3/-/issues.atom?state=opened" ispconfig)
  95. ;; ("https://tg.i-c-a.su/rss/ru_nixos" telegram nixos) ;Telegram NixOS
  96. ))
  97. (defun elfeed-config ()
  98. (interactive)
  99. (find-file
  100. (expand-file-name
  101. "~/.local/share/chezmoi/private_dot_emacs.d/modules/elfeed.el")))
  102. (defun elfeed-guix-show ()
  103. (interactive)
  104. (shell-command
  105. (format "guix show %s"
  106. (cadr (split-string (elfeed-entry-title
  107. (car (elfeed-search-selected)))
  108. ": ")))))
  109. (with-eval-after-load 'elfeed
  110. (defun wi-elfeed-search-show-entry ()
  111. "Call `elfeed-search-show-entry' with `shr-width' setted to NIL."
  112. (interactive)
  113. (let ((shr-width nil))
  114. (call-interactively 'elfeed-search-show-entry)))
  115. (defun wi-elfeed-search-update--force ()
  116. (interactive)
  117. (elfeed-db-save)
  118. (call-interactively 'elfeed-search-update--force))
  119. ;; (setq elfeed-search-remain-on-entry t)
  120. (setq elfeed-show-entry-switch 'display-buffer)
  121. (let ((map elfeed-search-mode-map))
  122. (define-key map (kbd "RET") 'wi-elfeed-search-show-entry)
  123. (define-key map (kbd "g") 'wi-elfeed-search-update--force)
  124. (define-key map (kbd "h") 'other-window)
  125. (define-key map (kbd "SPC") 'scroll-up-command)
  126. (define-key map (kbd "S-SPC") 'scroll-down-command)
  127. (define-key map (kbd "<f8>") 'elfeed-config)
  128. (define-key map (kbd "B") 'elfeed-guix-show)
  129. (define-key map (kbd "=") 'elfeed-score-map)
  130. (define-key map (kbd "<f7>") 'elfeed-show-guix-emacs-package)
  131. ;; https://www.reddit.com/r/emacs/comments/hq3r36/elfeed_configuration_to_display_in_next_window/
  132. ;; (define-key map (kbd "n")
  133. ;; '(lambda ()
  134. ;; (interactive)
  135. ;; (next-line)
  136. ;; (call-interactively 'elfeed-search-show-entry)))
  137. ;; (define-key map (kbd "p")
  138. ;; '(lambda () (interactive)
  139. ;; (previous-line)
  140. ;; (call-interactively 'elfeed-search-show-entry)))
  141. )
  142. (let ((map elfeed-show-mode-map))
  143. (define-key map (kbd "h") 'other-window))
  144. ;; (setq elfeed-search-title-max-width 120)
  145. (add-hook 'elfeed-show-mode-hook 'visual-line-mode)
  146. (setq elfeed-search-filter "@1-weeks-ago +unread -ci -vc -elpa -shopping -gov -censor")
  147. ;; score
  148. (setq elfeed-search-print-entry-function #'elfeed-score-print-entry)
  149. (elfeed-score-enable))
  150. (run-at-time nil (* 60 10)
  151. #'(lambda ()
  152. (let ((time (current-idle-time)))
  153. (when (and time (> (time-to-seconds time) (* 60 5)))
  154. (elfeed-update)))))
  155. ;;;
  156. ;;; org-capture
  157. ;;;
  158. ;; Thanks to http://heikkil.github.io/blog/2015/05/09/notes-from-elfeed-entries/
  159. (defun elfeed-link-title (entry)
  160. "Copy the entry title and URL as org link to the clipboard."
  161. (let ((titlelink (org-make-link-string (elfeed-entry-link entry)
  162. (elfeed-entry-title entry))))
  163. (when titlelink
  164. (kill-new titlelink)
  165. (x-set-selection 'PRIMARY titlelink)
  166. (message "Yanked: %s" titlelink))))
  167. (defun elfeed-show-link-title ()
  168. "Copy the current entry title and URL as org link to the clipboard."
  169. (interactive)
  170. (elfeed-link-title elfeed-show-entry))
  171. ;;;
  172. ;;; Guix
  173. ;;;
  174. (defun guix-show-emacs-package-without-prefix (package-without-prefix)
  175. (guix-package-get-display
  176. nil 'name (concat "emacs-"
  177. (substring package-without-prefix 0
  178. (seq-position (string-to-list package-without-prefix)
  179. (string-to-char " "))))))
  180. (defun elfeed-show-guix-emacs-package ()
  181. (interactive)
  182. (let* ((entry (elfeed-search-selected t))
  183. (title (elfeed-entry-title entry)))
  184. (elfeed-untag entry 'unread)
  185. (elfeed-search-update-entry entry)
  186. (unless (or elfeed-search-remain-on-entry (use-region-p))
  187. (forward-line))
  188. (guix-show-emacs-package-without-prefix title)
  189. (message title)))