Commit c5bdec99 authored by Kiste's avatar Kiste
Browse files

Better?

parent 93ecc03b
......@@ -91,7 +91,9 @@ def do_feed(url, rules_path, verbose):
link = entry['link']
if 'reformat' in url_rules:
for reformat in url_rules['reformat']:
link = link.replace(reformat['search'], reformat['replace'])
link = re.sub(reformat['search'], reformat['replace'], link)
if verbose:
print('Reformat: ' + link)
url = "{0.scheme}://{0.netloc}/".format(urllib.parse.urlsplit(link))
if verbose:
print('>Rule match!')
......
......@@ -27,8 +27,8 @@
"heisehack": true,
"reformat": [
{
"search": "wt_mc=rss.ho.beitrag.atom",
"replace": "seite=all"
"search": "html?.+=.+",
"replace": "html?seite=all"
}
],
"decompose": [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment