refactor iterations

This commit is contained in:
un-pogaz 2025-09-18 17:35:21 +02:00
parent 0976c55c24
commit 015d0c1e3f
2 changed files with 26 additions and 8 deletions

View File

@ -139,10 +139,19 @@ class expansion_spanish(BasicNewsRecipe):
return article
if link.split('/')[-1] == 'story01.htm':
link = link.split('/')[-2]
a = ['0B', '0C', '0D', '0E', '0F', '0G', '0N', '0L0S', '0A']
b = ['.', '/', '?', '-', '=', '&', '.com', 'www.', '0']
for i in range(len(a)):
link = link.replace(a[i], b[i])
t = (
('0B', '.'),
('0C', '/'),
('0D', '?'),
('0E', '-'),
('0F', '='),
('0G', '&'),
('0N', '.com'),
('0L0S', 'www.'),
('0A', '0'),
)
for a,b in t:
link = link.replace(a, b)
link = 'http://' + link
# Eliminar artículos duplicados en otros feeds

View File

@ -46,10 +46,19 @@ class IlSole24Ore(BasicNewsRecipe):
return article
if link.split('/')[-1] == 'story01.htm':
link = link.split('/')[-2]
a = ['0B', '0C', '0D', '0E', '0F', '0G', '0N', '0L0S', '0A']
b = ['.', '/', '?', '-', '=', '&', '.com', 'www.', '0']
for i in range(len(a)):
link = link.replace(a[i], b[i])
t = (
('0B', '.'),
('0C', '/'),
('0D', '?'),
('0E', '-'),
('0F', '='),
('0G', '&'),
('0N', '.com'),
('0L0S', 'www.'),
('0A', '0'),
)
for a,b in t:
link = link.replace(a, b)
link = 'http://' + link
return link