Analyzing Emacs News: 564 posts over 11 years
While summarizing my history with Emacs, I was curious about just how many Emacs News posts I've written and how many links I've highlighted. 564 posts, > 34000 items, an average of 60 items per posts.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
While summarizing my history with Emacs, I was curious about just how many Emacs News posts I've written and how many links I've highlighted. 564 posts, > 34000 items, an average of 60 items per posts.
Analysis: It turned out that my emacs-news/index.org only went back to about 2016, missing a few months of 2015. To fill in the data, I needed to convert the old HTML files into Org format.
find -name *news*.html -exec zsh -c 'pandoc -f html -t org {} --wrap=none -o $(basename {} .html).org' ;
Then I inserted the old entries into my file. insert-file-contents doesn't seem to move the point, but if I narrow to my Posts subtree (org-narrow-to-subtree), then I can go to the end of the narrowed part.
(defun sacha-emacs-news-insert-old-ones () (interactive) (let ((dir "~/proj/static-blog/blog/2015/")) (dolist (f (sort (directory-files-recursively dir "news.org$") :key #'file-name-base :reverse t)) (insert "* " (substring (file-name-base f) 0 10) " Emacs News\n\n") (insert-file-contents f) (goto-char (point-max)))))
With all the entries in place, let's look at the list items that start with a link.
;;;###autoload (defun sacha-emacs-news-count-links () "Return the number of main links in this subtree." (interactive) (let ((count 0)) (save-excursion (org-back-to-heading) (while (re-search-forward "^ *- \[\[" (save-excursion (org-end-of-subtree)) t) (incf count))) (when (called-interactively-p 'any) (message "%d" count)) count))
;;;###autoload (defun sacha-emacs-news-analyze () "Count how many entries and items. Make a table of entries." (interactive) (with-current-buffer (find-file-noselect "~/sync/emacs-news/index.org") (goto-char (point-min)) (let (results) (org-map-entries (lambda () (let ((title (org-entry-get (point) "ITEM"))) (when (string-match "\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\) Emacs" title) (push (list (match-string 1 title) (sacha-emacs-news-count-links)) results))))) (seq-uniq (sort results :key 'car :reverse t)))))
(append '(("Date" "Count") hline) (sacha-emacs-news-analyze))
set title "Number of links in Emacs News per week" set xdata time set timefmt "%Y-%m-%d" set format x "%Y" set xlabel "Year" set ylabel "Count" set grid plot data using 1:2 with lines title "Items"
This probably tracks my availability more than anything else. The dip in 2017 and 2018 corresponds pretty well to the time that the kiddo needed more of my attention. Babies sleep a lot; toddlers, not so much.
I generally feel that there are so many interesting rabbit holes to go down each week, and the Emacs community is active enough that there's always one or two things I want to add to my to-do list to explore further. Putting together Emacs News is one of the highlights of my week. It takes me about 1 - 2 hours, and some of that is just because I get distracted trying out the cool stuff I come across.
Here's the table, in case you're curious:
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。