mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
fix(codeberg): css selector tweak (#3832)
* fix(codeberg): css selector tweak * yup
This commit is contained in:
parent
0c4b498d4f
commit
38e9c396cf
@ -79,9 +79,9 @@ class CodebergBridge extends BridgeAbstract
|
|||||||
|
|
||||||
public function collectData()
|
public function collectData()
|
||||||
{
|
{
|
||||||
$html = getSimpleHTMLDOM($this->getURI());
|
$url = $this->getURI();
|
||||||
|
$html = getSimpleHTMLDOM($url);
|
||||||
$html = defaultLinkTo($html, $this->getURI());
|
$html = defaultLinkTo($html, $url);
|
||||||
|
|
||||||
switch ($this->queriedContext) {
|
switch ($this->queriedContext) {
|
||||||
case 'Commits':
|
case 'Commits':
|
||||||
@ -205,22 +205,22 @@ class CodebergBridge extends BridgeAbstract
|
|||||||
*/
|
*/
|
||||||
private function extractIssues($html)
|
private function extractIssues($html)
|
||||||
{
|
{
|
||||||
$div = $html->find('div.issue.list', 0);
|
$issueList = $html->find('div#issue-list', 0);
|
||||||
|
|
||||||
foreach ($div->find('li.item') as $li) {
|
foreach ($issueList->find('div.flex-item') as $div) {
|
||||||
$item = [];
|
$item = [];
|
||||||
|
|
||||||
$number = trim($li->find('a.index,ml-0.mr-2', 0)->plaintext);
|
$number = trim($div->find('a.index,ml-0.mr-2', 0)->plaintext);
|
||||||
|
|
||||||
$item['title'] = $li->find('a.title', 0)->plaintext . ' (' . $number . ')';
|
$item['title'] = $div->find('a.issue-title', 0)->plaintext . ' (' . $number . ')';
|
||||||
$item['uri'] = $li->find('a.title', 0)->href;
|
$item['uri'] = $div->find('a.issue-title', 0)->href;
|
||||||
|
|
||||||
$time = $li->find('relative-time.time-since', 0);
|
$time = $div->find('relative-time.time-since', 0);
|
||||||
if ($time) {
|
if ($time) {
|
||||||
$item['timestamp'] = $time->datetime;
|
$item['timestamp'] = $time->datetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['author'] = $li->find('div.desc', 0)->find('a', 1)->plaintext;
|
//$item['author'] = $li->find('div.desc', 0)->find('a', 1)->plaintext;
|
||||||
|
|
||||||
// Fetch issue page
|
// Fetch issue page
|
||||||
$issuePage = getSimpleHTMLDOMCached($item['uri'], 3600);
|
$issuePage = getSimpleHTMLDOMCached($item['uri'], 3600);
|
||||||
@ -228,7 +228,7 @@ class CodebergBridge extends BridgeAbstract
|
|||||||
|
|
||||||
$item['content'] = $issuePage->find('div.timeline-item.comment.first', 0)->find('div.render-content.markup', 0);
|
$item['content'] = $issuePage->find('div.timeline-item.comment.first', 0)->find('div.render-content.markup', 0);
|
||||||
|
|
||||||
foreach ($li->find('a.ui.label') as $label) {
|
foreach ($div->find('a.ui.label') as $label) {
|
||||||
$item['categories'][] = $label->plaintext;
|
$item['categories'][] = $label->plaintext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user