mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[PikabuBridge] Skip sponsored posts (#2983)
* [PikabuBridge] Skip sponsored posts Sponsored posts appear very rarely in html code. But when they appear, they always have different url that results junk feed. One of the example is [1]. After visiting it, you will be redirected to [2] that is marked as "Партнёрский материал" in Russian, or "Sponsored post" in English. [1] https://pikabu.ru/story/a_mla_posa_m_memu_seyla_otorathche_idomikhlenonoikhmyav_sseyla_otoratazoed__9388770?from=cpm [2] https://pikabu.ru/story/kakim_dolzhen_byit_vash_noutbuk_9388770 * lint Co-authored-by: Dag <me@dvikan.no>
This commit is contained in:
parent
fd0d5350be
commit
43ad54dba0
@ -132,6 +132,10 @@ class PikabuBridge extends BridgeAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
$title_element = $post->find('.story__title-link', 0);
|
$title_element = $post->find('.story__title-link', 0);
|
||||||
|
if (str_contains($title_element->href, 'from=cpm')) {
|
||||||
|
// skip sponsored posts
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$title = $title_element->plaintext;
|
$title = $title_element->plaintext;
|
||||||
$community_link = $post->find('.story__community-link', 0);
|
$community_link = $post->find('.story__community-link', 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user