Skip to content

Commit c92bdbc

Browse files
add RestOfWorld to supported publisher
1 parent f5c42c3 commit c92bdbc

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

docs/supported_publishers.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3357,6 +3357,25 @@
33573357
<code>description</code>
33583358
</td>
33593359
</tr>
3360+
<tr>
3361+
<td>
3362+
<code>RestOfWorld</code>
3363+
</td>
3364+
<td>
3365+
<div>Rest of World</div>
3366+
</td>
3367+
<td>
3368+
<a href="https://restofworld.org/">
3369+
<span>restofworld.org</span>
3370+
</a>
3371+
</td>
3372+
<td>
3373+
<code>en</code>
3374+
</td>
3375+
<td>&#160;</td>
3376+
<td>&#160;</td>
3377+
<td>&#160;</td>
3378+
</tr>
33603379
<tr>
33613380
<td>
33623381
<code>Reuters</code>

src/fundus/publishers/us/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .free_beacon import FreeBeaconParser
1010
from .la_times import LATimesParser
1111
from .occupy_democrats import OccupyDemocratsParser
12+
from .rest_of_world import RestOfWorldParser
1213
from .reuters import ReutersParser
1314
from .rolling_stone import RollingStoneParser
1415
from .techcrunch import TechCrunchParser
@@ -21,7 +22,6 @@
2122
from .washington_times import WashingtonTimesParser
2223
from .wired import WiredParser
2324
from .world_truth import WorldTruthParser
24-
from .rest_of_world import RestOfWorldParser
2525

2626

2727
class US(metaclass=PublisherGroup):
@@ -275,14 +275,13 @@ class US(metaclass=PublisherGroup):
275275
Sitemap("https://www.wired.com/sitemap-archive-1.xml"),
276276
],
277277
)
278-
278+
279279
RestOfWorld = Publisher(
280280
name="Rest of World",
281281
domain="https://restofworld.org/",
282282
parser=RestOfWorldParser,
283283
sources=[
284284
RSSFeed("https://restofworld.org/feed/latest/"),
285285
Sitemap("https://restofworld.org/sitemap.xml"),
286-
]
287-
286+
],
288287
)

src/fundus/publishers/us/rest_of_world.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@ class RestOfWorldParser(ParserProxy):
1717
class V1(BaseParser):
1818
VALID_UNTIL = date.today()
1919

20-
_summary_selector: CSSSelector = CSSSelector(
21-
"div.post-subheader__summary li, p.post-header__text__dek"
22-
)
23-
_paragraph_selector: CSSSelector = CSSSelector(
24-
"div.post-content > p"
25-
)
26-
_subheadline_selector: CSSSelector = CSSSelector(
27-
"div.post-content > h2"
28-
)
20+
_summary_selector: CSSSelector = CSSSelector("div.post-subheader__summary li, p.post-header__text__dek")
21+
_paragraph_selector: CSSSelector = CSSSelector("div.post-content > p")
22+
_subheadline_selector: CSSSelector = CSSSelector("div.post-content > h2")
2923

3024
@attribute
3125
def body(self) -> Optional[ArticleBody]:
@@ -64,4 +58,4 @@ def images(self) -> List[Image]:
6458
"(./ancestor::figure//*[contains(@class, 'credit') or contains(@class, 'byline')])[last()]"
6559
),
6660
relative_urls=True,
67-
)
61+
)

0 commit comments

Comments
 (0)