Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tianyizheng02
Copy link
Contributor

@tianyizheng02 tianyizheng02 commented Aug 20, 2024

Fixes #128, fixes #166

Rewrite the news module because the underlying news API has been dead for years. The rewritten news.py scrapes the Pittwire website for official Pitt news articles. The rewritten unit tests for news.py mocks API requests and achieves 100% code coverage with pytest.

Rewrite the news module because the underlying news API has been dead
for years. The rewritten news.py scrapes the Pittwire website for
official Pitt news articles. The rewritten unit tests for news.py mocks
API requests and achieves 100% code coverage with pytest.
)
PITT_BASE_URL = "https://www.pitt.edu"

Category = Literal["features-articles", "accolades-honors", "ones-to-watch", "announcements-and-updates"]
Copy link
Member

Choose a reason for hiding this comment

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

Why are the categories and topics hard-coded? These will probably change over time right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, Pittwire might add/remove topics over time (though I suspect that the categories are much less likely to change). We could scrape the lists of categories and topics so that they don't need to be hard-coded, but that'll break if the website layout changes too drastically. If you feel like that's a better alternative, we can do that in a separate PR. Otherwise, we'll just need to keep an eye on the Pittwire website occasionally to make sure that the lists are up-to-date.

Copy link
Member

Choose a reason for hiding this comment

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

We should scrape it. We have no idea what the maintenance of this repo will look like over time. It's certainly had its lulls over time, so let's make it withstand the lack of us

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.

Non-mocked tests should be mocked Any API using m.pitt.edu are dead, new scrapers needed!

4 participants