Venus merge request: xpath-sifter configuration example
Mary Gardiner
mary at puzzling.org
Wed Apr 16 12:51:44 EST 2008
I am not fluent in XPath and yet wanted to use the xpath-sifter.py
function. In case there are others in my boat I've done a slightly more
verbose example. bzr branch is at
http://users.puzzling.org/users/mary/bzr/venus/branches/venus-xsltdoc/
and the actual documentation file is attached.
-Mary
-------------- next part --------------
# 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: <category term="two"/>, 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')]
More information about the devel
mailing list