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

Addition of Braunschweiger Zeitung #340

Merged
merged 7 commits into from
Feb 12, 2024
Merged

Conversation

addie9800
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@MaxDall MaxDall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this 👍

src/fundus/publishers/de/__init__.py Outdated Show resolved Hide resolved
domain="https://www.braunschweiger-zeitung.de/",
sources=[
RSSFeed("https://www.braunschweiger-zeitung.de/rss"),
Sitemap("https://www.braunschweiger-zeitung.de/sitemaps/news.xml"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a NewsMap to me and not a Sitemap

PS:
There also seems to be a sitemap judging by this link https://www.braunschweiger-zeitung.de/sitemaps/archive/sitemap-2017-08-p00.xml.gz
Looks like a monthly pattern with pagination.

Could you check for what date range you get something back and if there is a second page p01?
And afterwards add this as a sitemap?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, how did you find it? I checked the robots.txt file and that only mentioned the NewsMap. Regarding the SiteMap: it seems rather weird. The earliest I can find is: https://www.braunschweiger-zeitung.de/sitemaps/archive/sitemap-2006-11-p00.xml.gz (at least if you consider the dates in the url), but if you access the sitemap, it covers articles from September 2016. I think that is the correct lower bound of available dates though. If using dates after that, it seems to work just fine. There's no page 1, one file seems to contain all articles of that month. In case I would want to add it, how would I go about it? I am having trouble to find an index for the sitemaps

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it by searching for braunschweiger-zeitung.de sitemap in google.

from datetime import datetime
from dateutil.rrule import rrule, MONTHLY

from fundus import Sitemap

sitemaps = [
    Sitemap(
        f"https://www.braunschweiger-zeitung.de/sitemaps/archive/sitemap-{d.year}-{str(d.month).zfill(2)}-p00.xml.gz"
    )
    for d in reversed(list(rrule(MONTHLY, dtstart=datetime(2016, 9, 1), until=datetime.now())))
]

This snippet generates all available sitemaps. You can add it with the + operator to sources.

src/fundus/publishers/de/braunschweiger_zeitung.py Outdated Show resolved Hide resolved
src/fundus/publishers/de/braunschweiger_zeitung.py Outdated Show resolved Hide resolved
src/fundus/publishers/de/braunschweiger_zeitung.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@MaxDall MaxDall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this 👍

src/fundus/publishers/de/braunschweiger_zeitung.py Outdated Show resolved Hide resolved
@addie9800 addie9800 requested a review from MaxDall February 6, 2024 22:38
@MaxDall
Copy link
Collaborator

MaxDall commented Feb 8, 2024

There are merge conflicts with master that should be resolved before i can review this.

@addie9800
Copy link
Collaborator Author

Sorry about that, I fixed the conflicts now.

@addie9800 addie9800 merged commit 171dbbb into master Feb 12, 2024
5 checks passed
@addie9800 addie9800 deleted the add_braunschweiger_zeitung branch February 12, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants