|
UniNews
University news from Greek and international universities in one place
|
Public Member Functions | |
| __init_subclass__ (cls, **kwargs) | |
| __init__ (self, str publisher, str category, dict config) | |
| str | __repr__ (self) |
| list[dict] | fetch_raw (self) |
| list[Article] | fetch (self) |
| requests.Response | request (self, str url) |
| str | get_html (self, str url) |
Public Attributes | |
| publisher | |
| category | |
| config | |
Static Public Attributes | |
| ClassVar | fetcher_type = "" |
| tuple | required_keys = ("label", "url") |
| dict | registry = {} |
One page or feed to fetch, configured by a JSON entry. Subclasses set `fetcher_type` (the JSON "type" value) and implement fetch_raw(). Defining a subclass registers it automatically.
| uninews.fetchers.base.Fetcher.__init__ | ( | self, | |
| str | publisher, | ||
| str | category, | ||
| dict | config | ||
| ) |
Reimplemented in uninews.fetchers.html.HtmlFetcher.
| uninews.fetchers.base.Fetcher.__init_subclass__ | ( | cls, | |
| ** | kwargs | ||
| ) |
| str uninews.fetchers.base.Fetcher.__repr__ | ( | self | ) |
| list[Article] uninews.fetchers.base.Fetcher.fetch | ( | self | ) |
Fetch, clean, and deduplicate. This is what the app calls.
| list[dict] uninews.fetchers.base.Fetcher.fetch_raw | ( | self | ) |
Return dicts with 'title' and 'link'. Optional keys: 'published', 'summary', 'image_url'. Links and image URLs may be relative.
Reimplemented in uninews.fetchers.html.HtmlFetcher, and uninews.fetchers.rss.RssFetcher.
| str uninews.fetchers.base.Fetcher.get_html | ( | self, | |
| str | url | ||
| ) |
| requests.Response uninews.fetchers.base.Fetcher.request | ( | self, | |
| str | url | ||
| ) |
| uninews.fetchers.base.Fetcher.category |
| uninews.fetchers.base.Fetcher.config |
|
static |
| uninews.fetchers.base.Fetcher.publisher |
|
static |
|
static |