diff --git a/examples/filters/xpath-sifter/xpath-sifter.ini b/examples/filters/xpath-sifter/xpath-sifter.ini new file mode 100644 index 0000000..82e354b --- /dev/null +++ b/examples/filters/xpath-sifter/xpath-sifter.ini @@ -0,0 +1,33 @@ +# The xpath_sifter filter allows you to stop entries from a feed being displayed +# if they do not match a particular pattern. + +# It is useful for things like only displaying entries in a particular category +# even if the site does not provide per category feeds, and displaying only entries +# that contain a particular string in their title. + +# The xpath_sifter filter applies only after all feeds are normalised to Atom 1.0. +# Look in your cache to see what entries look like. + +[Planet] +filters = xpath_sifter.py + +# We are only interested in entries in the category "two" from this blogger, but +# he does not provide a per-category feed. +# The Atom for categories looks like this: , so here +# we filter the http://example.com/uncategorised.xml file for entries with a +# category tag with the term attribute equal to 'two' +[http://example.com/uncategorised.xml] +name = Category 'two' (from Site Without a Categorised Feed) +[xpath_sifter.py] +require: + //atom:category[@term='two'] + +# The verbose blogger whose feed is below blogs about many subjects but we are +# only interested in entries about Venus. She does not use categories but +# fortunately her titles are very consistent, so we search within the title +# tag's text for the text 'Venus' +[http://example.com/verbose.xml] +name = Venus (from Verbose Site) +[xpath_sifter.py] +require: + //atom:title[contains(.,'Venus')]