Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kiste
ftfdscrpr
Commits
c5bdec99
Commit
c5bdec99
authored
Mar 02, 2018
by
Kiste
Browse files
Better?
parent
93ecc03b
Changes
2
Hide whitespace changes
Inline
Side-by-side
ftfdscrpr/ftfdscrpr.py
View file @
c5bdec99
...
...
@@ -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!'
)
...
...
rules.json
View file @
c5bdec99
...
...
@@ -27,8 +27,8 @@
"heisehack"
:
true
,
"reformat"
:
[
{
"search"
:
"
wt_mc=rss.ho.beitrag.atom
"
,
"replace"
:
"seite=all"
"search"
:
"
html?.+=.+
"
,
"replace"
:
"
html?
seite=all"
}
],
"decompose"
:
[
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment