From 4986119f1fd8bab05f05abbcf90615d623dc8d4b Mon Sep 17 00:00:00 2001 From: Dag Date: Tue, 23 Jan 2024 22:25:43 +0100 Subject: [PATCH] fix(codeberg): semi-fix parsing of pull requests (#3916) --- bridges/CodebergBridge.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bridges/CodebergBridge.php b/bridges/CodebergBridge.php index 79dd706c..8bccd250 100644 --- a/bridges/CodebergBridge.php +++ b/bridges/CodebergBridge.php @@ -275,22 +275,26 @@ class CodebergBridge extends BridgeAbstract */ private function extractPulls($html) { - $div = $html->find('div.issue.list', 0); + $div = $html->find('div#issue-list', 0); - foreach ($div->find('li.item') as $li) { + $var2 = $div->find('div.flex-item'); + foreach ($var2 as $li) { $item = []; $number = trim($li->find('a.index,ml-0.mr-2', 0)->plaintext); - $item['title'] = $li->find('a.title', 0)->plaintext . ' (' . $number . ')'; - $item['uri'] = $li->find('a.title', 0)->href; + $a = $li->find('a.issue-title', 0); + $item['title'] = $a->plaintext . ' (' . $number . ')'; + $item['uri'] = $a->href; $time = $li->find('relative-time.time-since', 0); if ($time) { $item['timestamp'] = $time->datetime; } - $item['author'] = $li->find('div.desc', 0)->find('a', 1)->plaintext; + // Extracting the author is a bit awkward after they changed their html + //$desc = $li->find('div.desc', 0); + //$item['author'] = $desc->find('a', 1)->plaintext; // Fetch pull request page $pullRequestPage = getSimpleHTMLDOMCached($item['uri'], 3600);