urlwatch 1.1
[urlwatch.git] / hooks.py
blob7a269f458c6f2943d9c0b7de6874697ecea19250
1 # Example hooks file to go with watch.py
2 # You can see which filter you want to apply using the URL
3 # parameter and you can use the "re" module to search for
4 # the part that you want to filter, so the noise is removed.
6 import re
8 def filter(url, data):
9 if url == 'http://www.inso.tuwien.ac.at/lectures/usability/':
10 return re.sub('.*TYPO3SEARCH_end.*', '', data)
11 elif url == 'https://www.auto.tuwien.ac.at/courses/viewDetails/11/':
12 return re.sub('</html><!-- \d+ -->', '', data)
13 return data