From e096eabd56b1b59755b6019218d8dcbdeca8b53d Mon Sep 17 00:00:00 2001 From: Tyler <84991471+tyler000000@users.noreply.github.com> Date: Thu, 25 Dec 2025 15:59:58 -0500 Subject: [PATCH 1/2] SPL Center bridge: fix and offer to maintain --- bridges/SplCenterBridge.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/bridges/SplCenterBridge.php b/bridges/SplCenterBridge.php index af25ec48e6f..fc5e829bd95 100644 --- a/bridges/SplCenterBridge.php +++ b/bridges/SplCenterBridge.php @@ -5,16 +5,16 @@ class SplCenterBridge extends FeedExpander const NAME = 'Southern Poverty Law Center Bridge'; const URI = 'https://www.splcenter.org'; const DESCRIPTION = 'Returns the newest posts from the Southern Poverty Law Center'; - const MAINTAINER = 'VerifiedJoseph'; + const MAINTAINER = 'tyler000000'; const PARAMETERS = [[ 'content' => [ 'name' => 'Content', 'type' => 'list', 'values' => [ - 'News' => 'news', + 'Stories' => 'stories', 'Hatewatch' => 'hatewatch', ], - 'defaultValue' => 'news', + 'defaultValue' => 'stories', ] ] ]; @@ -23,8 +23,19 @@ class SplCenterBridge extends FeedExpander public function collectData() { - $url = $this->getURI() . '/rss.xml'; - $this->collectExpandableDatas($url); + $dom = getSimpleHTMLDOM($this->getURI()); + foreach ($dom->find('ul.wp-block-post-template li') as $li) { + $a = $li->find('h3 > a', 0); + if ($a && trim($a->plaintext) !== '') { + $this->items[] = [ + 'title' => $a->plaintext, + 'uri' => $a->href, + 'author' => $li->find('p.wp-block-splc-authors__name', 0)->plaintext, + 'content' => $li->find('p.wp-block-post-excerpt__excerpt', 0)->plaintext, + 'timestamp' => date("U",strtotime($li->find('time', 0)->getAttribute('datetime'))), + ]; + } + } } protected function parseItem(array $item) @@ -44,7 +55,7 @@ protected function parseItem(array $item) public function getURI() { if (!is_null($this->getInput('content'))) { - return self::URI . '/' . $this->getInput('content'); + return self::URI . '/resources/' . $this->getInput('content'); } return parent::getURI(); From 613162b1079120dccc38078c87d0ba0f85373418 Mon Sep 17 00:00:00 2001 From: Tyler <84991471+tyler000000@users.noreply.github.com> Date: Fri, 10 Apr 2026 09:05:02 -0400 Subject: [PATCH 2/2] SPL Center bridge: rewrite news as stories --- bridges/SplCenterBridge.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bridges/SplCenterBridge.php b/bridges/SplCenterBridge.php index fc5e829bd95..d257d9c9152 100644 --- a/bridges/SplCenterBridge.php +++ b/bridges/SplCenterBridge.php @@ -55,7 +55,12 @@ protected function parseItem(array $item) public function getURI() { if (!is_null($this->getInput('content'))) { - return self::URI . '/resources/' . $this->getInput('content'); + $content = $this->getInput('content'); + if ($content == 'news') { + $content = 'stories'; + } + + return self::URI . '/resources/' . $content; } return parent::getURI();