Skip to content
This repository was archived by the owner on Jul 21, 2021. It is now read-only.

Commit a64a41d

Browse files
committed
Fix update-download-stats.
1 parent 8cb0f1a commit a64a41d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/quicklisp-blog.lisp

+8-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
(retrieve-entries url)
2828
(let ((entry
2929
(find-if (lambda (entry)
30-
(ppcre:scan "download stats" (plump:text (aref (clss:select "title" entry) 0))))
30+
(ppcre:scan "(?i)download stats" (plump:text (aref (clss:select "title" entry) 0))))
3131
entries)))
3232
(cond
3333
(entry (return entry))
@@ -40,8 +40,13 @@
4040
(return-from latest-download-stats))
4141

4242
(let* ((content (plump:parse (plump:text (aref (clss:select "content" entry) 0))))
43-
(content (plump:text (aref (clss:select "pre" content) 0)))
44-
(children (split-sequence #\Space content :remove-empty-subseqs t)))
43+
(children
44+
(remove ""
45+
(map 'list
46+
(lambda (el)
47+
(string-trim '(#\Space #\Tab #\Newline) (plump:text el)))
48+
(plump:children (aref (clss:select "pre" content) 0)))
49+
:test #'string=)))
4550

4651
(values
4752
(loop for (count name) on children by #'cddr

0 commit comments

Comments
 (0)