Implement basic title search check

This commit is contained in:
Henrik Lissner 2014-02-07 00:53:48 -05:00
parent 67059c6f32
commit f0fb633924
2 changed files with 7 additions and 2 deletions

View file

@ -14,6 +14,7 @@ import feedparser
import time
import sys
import os
import re
###
@ -63,10 +64,14 @@ try:
##
fo = open(GUID_FILE, "a")
for feed in feeds:
xml = feedparser.parse(feed)
f = feed.split(' ', 1)
xml = feedparser.parse(f[0])
for e in xml.entries:
if e.guid not in guids:
if len(f) > 1 and not re.match(f[1], e.title):
continue
prowl_post(apikey, "RSS", e.title, "{0} - {1} <{2}>".format(e.title, xml.feed.title, e.link))
fo.write(e.guid+"\n")

View file

@ -108,7 +108,7 @@ if command_exists "ag"; then
# Project-wide search 'n replace using the_silver_searcher:
# https://github.com/ggreer/the_silver_searcher
function agr {
ag -l "$1" | xargs repl "$1" "$2" -i
ag -l "$1" | xargs sed -i -e "s/${1/\//\\\/}/${2/\//\\\/}/g"
ag "$2"
}
fi