1
0
Fork 0
forked from blallo/rss-bridge

[GooglePlusPostBridge] Add option to include image in content

References #600
This commit is contained in:
logmanoriginal 2018-07-31 19:08:37 +02:00
parent 5f3c55b808
commit 53278b2eed

View file

@ -14,6 +14,11 @@ class GooglePlusPostBridge extends BridgeAbstract{
'username' => array(
'name' => 'username or Id',
'required' => true
),
'include_media' => array(
'name' => 'Include media',
'type' => 'checkbox',
'title' => 'Enable to include media in the feed content'
)
));
@ -52,7 +57,7 @@ class GooglePlusPostBridge extends BridgeAbstract{
$message = $post->find('div[jsname=EjRJtf]', 0);
$item['content'] = '<div style="float: left; padding: 10px;"><a href="'
$item['content'] = '<div style="float: left; padding: 0 10px 10px 0;"><a href="'
. $this->url
. '"><img align="top" alt="'
. $item['author']
@ -83,6 +88,14 @@ class GooglePlusPostBridge extends BridgeAbstract{
$item['enclosures'][] = $this->fixImage($img)->src;
}
if($this->getInput('include_media') === true && count($item['enclosures'] > 0)) {
$item['content'] .= '<div style="clear: both;"><a href="'
. $item['enclosures'][0]
. '"><img src="'
. $item['enclosures'][0]
. '" /></a></div>';
}
}
// Add custom parameters (only useful for JSON or Plaintext)