mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-10 17:08:47 +00:00
[RadioMelodieBridge] Fix article content (#3230)
- remove the social network share section ath the beginning and and the end of the article - removte the HTML formated article tilthe from the content - limite the author picture size to 60 px
This commit is contained in:
parent
b21806a0b3
commit
57e79e7f1b
@ -26,6 +26,14 @@ class RadioMelodieBridge extends BridgeAbstract
|
|||||||
$article = str_get_html($article->save());
|
$article = str_get_html($article->save());
|
||||||
$textDOM = $article->find('article', 0);
|
$textDOM = $article->find('article', 0);
|
||||||
|
|
||||||
|
// Remove HTML code for the article title
|
||||||
|
$textDOM->find('h1', 0)->outertext = '';
|
||||||
|
|
||||||
|
// Fix the CSS for the author
|
||||||
|
$textDOM->find('div[class=author]', 0)->find('img', 0)
|
||||||
|
->setAttribute('style', 'width: 60px; margin: 0 15px; display: inline-block; vertical-align: top;');
|
||||||
|
|
||||||
|
|
||||||
// Initialise arrays
|
// Initialise arrays
|
||||||
$item = [];
|
$item = [];
|
||||||
$audio = [];
|
$audio = [];
|
||||||
@ -76,6 +84,7 @@ class RadioMelodieBridge extends BridgeAbstract
|
|||||||
|
|
||||||
// Remove the share article part
|
// Remove the share article part
|
||||||
$textDOM->find('div[class=share]', 0)->outertext = '';
|
$textDOM->find('div[class=share]', 0)->outertext = '';
|
||||||
|
$textDOM->find('div[class=share]', 1)->outertext = '';
|
||||||
|
|
||||||
// Rewrite relative Links
|
// Rewrite relative Links
|
||||||
$textDOM = defaultLinkTo($textDOM, self::URI . '/');
|
$textDOM = defaultLinkTo($textDOM, self::URI . '/');
|
||||||
|
Loading…
Reference in New Issue
Block a user