Skip to content

Commit

Permalink
[BakaUpdatesMangaReleasesBridge] filter title and groups (RSS-Bridge#…
Browse files Browse the repository at this point in the history
…1058)

Baka-Updates Manga uses an asterisk (*) to denote series information have
been updated within the last 24 hours. This is not helpful in a feed.
  • Loading branch information
fulmeek authored and logmanoriginal committed Mar 14, 2019
1 parent 6f2d60f commit feb5e71
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bridges/BakaUpdatesMangaReleasesBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function collectData() {
);

if (isset($rows[0][1])) {
$this->feedName = html_entity_decode($rows[0][1]->plaintext);
$this->feedName = $this->filterHTML($rows[0][1]->plaintext);
}

foreach($rows as $cols) {
Expand All @@ -48,8 +48,8 @@ public function collectData() {

$objTitle = $cols[1];
if ($objTitle) {
$title[] = html_entity_decode($objTitle->plaintext);
$item['content'] .= '<p>Series: ' . $objTitle->innertext . '</p>';
$title[] = $this->filterHTML($objTitle->plaintext);
$item['content'] .= '<p>Series: ' . $this->filterText($objTitle->innertext) . '</p>';
}

$objVolume = $cols[2];
Expand All @@ -62,8 +62,8 @@ public function collectData() {

$objAuthor = $cols[4];
if ($objAuthor && !empty($objAuthor->plaintext)) {
$item['author'] = html_entity_decode($objAuthor->plaintext);
$item['content'] .= '<p>Groups: ' . $objAuthor->innertext . '</p>';
$item['author'] = $this->filterHTML($objAuthor->plaintext);
$item['content'] .= '<p>Groups: ' . $this->filterText($objAuthor->innertext) . '</p>';
}

$item['title'] = implode(' ', $title);
Expand All @@ -88,4 +88,12 @@ public function getName(){
}
return parent::getName();
}

private function filterText($text) {
return rtrim($text, '*');
}

private function filterHTML($text) {
return $this->filterText(html_entity_decode($text));
}
}

0 comments on commit feb5e71

Please sign in to comment.