# 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]
# we are only applying the filter to certain feeds, so we do not configure it in the
# [Planet] section

### FIRST FEED: FILTER ON CATEGORY ###

# 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)

# This first version is the readable way to do it, but you'll run into trouble
# if you have any special characters, like spaces, in your require string
# filters = xpath_sifter.py?require=//atom:category[@term='two']

# Here's a URL quoted version:
filters = xpath_sifter.py?require=//atom%3Acategory%5B%40term%3D%27two%27%5D

# Here's a way to get the URL quoted version on the command line:
# python -c "import urllib; print urllib.quote('STRING');"
# eg
# python -c "import urllib; print urllib.quote('atom:category[@term=\'two\']');"

### SECOND FEED: FILTER ON TITLE ###

# 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)

# Non-quoted version
# filters = xpath_sifter.py?require=//atom:title[contains(.,'Venus')]
# Quoted version
filters = xpath_sifter.py?atom%3Atitle%5Bcontains%28.%2C%27Venus%27%29%5D

### THIRD FEED: NO FILTER ###

# We can include other feeds that do not have the filter applied
[http://example.com/normal.xml]
name = No filter applied
