1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-12 03:24:01 +02:00

fix: a bunch of small changes in multiple bridges (#2644)

Mostly refactors.
This commit is contained in:
Dag
2022-04-12 23:37:30 +02:00
committed by GitHub
parent 5b7dd45b20
commit b6e8350596
12 changed files with 81 additions and 46 deletions

View File

@@ -1,4 +1,5 @@
<?php
class ZenodoBridge extends BridgeAbstract {
const MAINTAINER = 'theradialactive';
const NAME = 'Zenodo';
@@ -17,10 +18,21 @@ class ZenodoBridge extends BridgeAbstract {
ENT_QUOTES
)
);
foreach($element->find('p', 0)->find('span') as $authors) {
$item['author'] = $item['author'] . $authors . '; ';
$p1 = $element->find('p', 0);
if ($p1) {
foreach ($p1->find('span') as $authors) {
$item['author'] = $item['author'] . $authors . '; ';
}
}
$content = $element->find('p.hidden-xs', 0)->find('a', 0)->innertext . '<br>';
$p2 = $element->find('p.hidden-xs', 0);
if ($p2) {
$content = $p2->find('a', 0)->innertext . '<br>';
} else {
$content = 'Nope';
}
$type = '<br>Type: ' . $element->find('span.label-default', 0)->innertext;
$raw_date = $element->find('small.text-muted', 0)->innertext;