Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/crawlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ find the image URL.
- attrs
- content
- contents
- element
- elements
- remove
- url

Expand Down Expand Up @@ -299,6 +301,8 @@ for entry in feed.for_date(pub_date):
options:
heading_level: 4
members:
- title
- link
- summary
- content0
- html
Expand Down
3 changes: 0 additions & 3 deletions src/comics/aggregator/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ def crawl(self, pub_date: dt.date) -> CrawlerResult:
url = page.src('img[id="theComicImage"]')
if not url:
url = page.content('meta[property="og:image"]')
assert url
return CrawlerImage(url)


Expand Down Expand Up @@ -361,7 +360,6 @@ def crawl(self, pub_date: dt.date) -> CrawlerResult:
if release["release"] == pub_date.strftime("%Y-%m-%d"):
page = self.parse_page(release["url"])
url = page.src('img[itemprop="image"]')
assert url
return CrawlerImage(url)

return None
Expand All @@ -384,7 +382,6 @@ def crawl(self, pub_date: dt.date) -> CrawlerResult:
for entry in feed.for_date(pub_date):
page = self.parse_page(entry.link)
url = page.src("img#cc-comic")
assert url
text = page.title("img#cc-comic")
title = re.sub(r".+? - (.+)", r"\1", entry.title)

Expand Down
15 changes: 15 additions & 0 deletions src/comics/aggregator/feedparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ class Entry:
[`content0`][comics.aggregator.feedparser.Entry.content0].
"""

title: str
"""The entry's title.

Commonly passed straight on as the
[`CrawlerImage`][comics.aggregator.crawler.CrawlerImage] title.
"""

link: str
"""The URL of the entry, e.g. the comic's page for this release.

Typically fed to
[`Crawler.parse_page()`][comics.aggregator.crawler.CrawlerBase.parse_page]
when the feed itself doesn't hold the image.
"""

summary: LxmlParser
"""The entry's summary, with
[`LxmlParser`][comics.aggregator.lxmlparser.LxmlParser] methods available
Expand Down
Loading