From b90a826ca6c3e804257403c2a6efa87717c8a0ec Mon Sep 17 00:00:00 2001 From: Lukas Anzinger Date: Sat, 16 Jan 2016 01:20:22 +0100 Subject: LWN.net: Add site config. --- lwn.net.txt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lwn.net.txt diff --git a/lwn.net.txt b/lwn.net.txt new file mode 100644 index 0000000..82c6e1a --- /dev/null +++ b/lwn.net.txt @@ -0,0 +1,35 @@ +# HTML5 anyone? The 1980s called, they want their HTML4 back. +# LWN uses so little markup that you really have to be creative. + +tidy: yes +prune: no + +single_page_link: //div[@class='ArticleText']//a[contains(text(), 'Full Story')]/@href +single_page_link: concat(//div[@class='ArticleText']//a[contains(text(), 'Read more')]/@href, 'bigpage') + +title: //h1 + +# After tiding the document, becomes . +author: //div[@class='FeatureByline']/strong +date: //div[@class='FeatureByline']/text()[preceding-sibling::br] +strip: //div[@class='FeatureByline'] + +# tidy will take care of fixing the tag mess that we make here. +replace_string(

):

+replace_string(

):

+replace_string(

):

+ +# Make extracting the content before "Log in to post comments" easier. +# And by "easier" I mean possible in all cases without going through +# a lot of XPath pain. +replace_string(
):
+replace_string(to post comments)):
+strip: //div[@class='ftrss-strip'] +body: //div[@class='ArticleText'] + +test_url: http://lwn.net/Articles/668318/ +test_url: http://lwn.net/Articles/668695/ +test_url: http://lwn.net/Articles/669114/ +test_url: http://lwn.net/Articles/670209/ +test_url: http://lwn.net/Articles/670209/rss +test_url: http://lwn.net/Articles/668318/rss -- cgit v1.3.1