Skip to content

Add support of valid 'enclosure' element#24

Open
gulch wants to merge 1 commit intothujohn:masterfrom
gulch:master
Open

Add support of valid 'enclosure' element#24
gulch wants to merge 1 commit intothujohn:masterfrom
gulch:master

Conversation

@gulch
Copy link

@gulch gulch commented Mar 31, 2016

Added support of 'enclosure' element with attributes.
Example:
<enclosure url="https://funtime.kiev.ua/uploads/img/grid/middle/2016/03/holod-do-drozhi-vzaperti-kiev-kvest-komnata-56f95fdecc6c2.jpg" type="image/jpeg" length="74061"/>

Code example:

$feed = new \Thujohn\Rss\Rss();
$feed->feed('2.0', 'UTF-8');
....
$item['enclosure'] = [
    'url'=> $image_url,
    'type' => mime_content_type($image_path),
    'length' => filesize($image_path)
];
$feed->item($item);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant