Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for Italian publishers, starting with La Repubblica #670

Merged
merged 12 commits into from
Jan 2, 2025
Prev Previous commit
Next Next commit
black
  • Loading branch information
MaxDall committed Dec 30, 2024
commit 9b89050d660e9770a36ba8696c74432ca400d8b1
18 changes: 10 additions & 8 deletions src/fundus/publishers/it/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
from datetime import datetime, timedelta

from dateutil.rrule import MONTHLY, rrule

from fundus.publishers.base_objects import Publisher, PublisherGroup
from fundus.publishers.it.la_repubblica import LaRepubblicaParser
from fundus.scraping.url import RSSFeed, Sitemap


class IT(metaclass=PublisherGroup):
LaRepubblica = Publisher(
name="La Repubblica",
domain="https://www.repubblica.it",
parser=LaRepubblicaParser,
sources=[
RSSFeed("https://www.repubblica.it/rss/homepage/rss2.0.xml"),
] + [
]
+ [
Sitemap(f"https://www.repubblica.it/sitemap-{date.strftime('%Y-%m')}.xml")
for date in reversed(list(rrule(
MONTHLY,
dtstart=datetime(2020, 1, 1),
until=datetime.now()+timedelta(days=30)
)))
for date in reversed(
list(rrule(MONTHLY, dtstart=datetime(2020, 1, 1), until=datetime.now() + timedelta(days=30)))
)
],
)

print(IT.LaRepubblica.source_mapping)


print(IT.LaRepubblica.source_mapping)