[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [UPDATE] site filter functions for slashdot.org and rt.com
On 2017-06-12 16:25, Katsumi Yamaoka wrote:
> In [emacs-w3m : No.12678]
> On Mon, 12 Jun 2017 00:35:24 -0400, Boruch Baum wrote:
>
> > At this point, I would welcome feedback. If there is no feedback, my
> > plan is to wait a few days, and then take a fresh look at the code to
> > see if I can prettify and optimize it.
>
> How big they are! I can hardly imagine those filters keep working
> for a long time. ;) But it's ok, I've committed those updates.
Thanks. My intention is to wait a few days for me to forget what I
wrote, and then take a fresh look at the code to see if I can optimize
and clean it up. If you use either web site, you will notice (and I
hope appreciate) the difference.
> > (defun w3m-filter-rt (url)
> [...]
> > (re-search-forward "<a\[^>\]+>\\(<img\[^>\]+>\\)</a>" p t)
>
> I've replaced things like "\[^>\]" with "[^>]".
Oh, I thought the backslashes were necessary, thanks.
>
> > (defun w3m-filter-slashdot (url)
> [...]
> > (while (re-search-forward "<ul id=\"group_\[^>\]+>\n\t+<li id=\"hiddens_\[0-9\]+\" class=\"hide\"></li>\n</ul>" nil t)
> > (replace-match ""))
>
> Do TABs really exist in the html source? (committed as is).
Absolutely. It's a real pain. But tabs are always such pain anywhere
(my opinion).
>
> > (while (re-search-forward "\\( beneath your current threshold.\\)</b></noscript>" nil t)
>
> Shouldn't "." be quoted as "\\."? (committed as is).
Hmm, I could be wrong. I'll check and test when I return to the code.
I can say that in my testing and use these past few days, it seemed to
work as submitted.
--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0