Comments (12)
can we have few functions to extract that details?
You can extend the reader yourself, because zend-feed has a plugin system. Please check the documentation: "zend-feed β Extending Feed and Entry APIs".
There will you find an example how to register a new namespace and read the specific elements.
All relevant elements are described here: "Media RSS Specification".
Originally posted by @froschdesign at zendframework/zend-feed#49 (comment)
from laminas-feed.
Thank you @froschdesign, i am still in learning phase looking forward to contribute to this space.
Originally posted by @rajjanorkar at zendframework/zend-feed#49 (comment)
from laminas-feed.
I'm sorry, the last code example in documentation doesn't work anymore. (See: #44)
Here can you find a workaround: zendframework/zend-feed#54 (comment)
Originally posted by @froschdesign at zendframework/zend-feed#49 (comment)
from laminas-feed.
FWIW, MRSS is exactly the extension I've been working with, though I've only looked at thumbnails/images in my implementation. Would be great to have that in core since it seems to be popular and is very useful.
Originally posted by @Synchro at zendframework/zend-feed#49 (comment)
from laminas-feed.
hi @Synchro thats nice, if you dont mind can you share your extension and that will be starting point for others.
Originally posted by @rajjanorkar at zendframework/zend-feed#49 (comment)
from laminas-feed.
A simple workaround parsing-rss-file-with-zend-2-feed-i-cant-get-media-tag
Originally posted by @alfredleo at zendframework/zend-feed#49 (comment)
from laminas-feed.
I will add the support for one of the next minor releases; 2.13 or 2.14. This includes the full Media RSS specification with unit tests and documentation.
Help is always welcome! π
Originally posted by @froschdesign at zendframework/zend-feed#49 (comment)
from laminas-feed.
You can add media objects using setEnclosure
method on entry
object. According to RSS 2.0 specs:
enclosure | Describes a media object that is attached to the item.
<enclosure> is an optional sub-element of .
It has three required attributes. url says where the enclosure is located, length says how big it is in bytes, and type says what its type is, a standard MIME type.
The url must be an http url.
When setting enclosure, you need to specify uri
instead of url
:
$entry->setEnclosure([
'uri' => get_absolute_url($path),
'type' => get_mime_type($path),
'length' => filesize($path),
]);
from laminas-feed.
@alexkuc
Correct, it is possible to add a media object via the enclosure element, but it is recommended to use only one object:
For best support in the widest number of aggregators, an item SHOULD NOT contain more than one enclosure.
https://www.rssboard.org/rss-profile#element-channel-item-enclosure
In the documentation it can be found in the reader section: https://docs.laminas.dev/laminas-feed/reader/#entry-api-methods
from laminas-feed.
Thank you for the link, @froschdesign. W3 was unfortunately ambiguous whether you can use more than 1 but your link clears up that nicely. I have left the code here for others in case they face similar dilemma.
@froschdesign is it still necessary to keep this issue open? Seems to me that functionality for adding media objects is already in place
from laminas-feed.
Seems to me that functionality for adding media objects is already in place
In the Media RSS specification you will find a lot more: https://www.rssboard.org/media-rss
from laminas-feed.
Ah, I see now:
RSS enclosures are already being used to syndicate audio files and images. Media RSS extends enclosures to handle other media types, such as short films or TV, as well as provide additional metadata with the media.
from laminas-feed.
Related Issues (20)
- Getting "failed to open stream: No such file or directory in /autoload.php on line 5" when loading package HOT 5
- Atom Feed canβt read Entry content if type is application/xml
- Replace usage of deprecated libxml_disable_entity_loader() HOT 2
- Psalm integration HOT 2
- PHP 8.0 support HOT 1
- PHPDoc return types incorrect/outdated HOT 1
- Method getDateModified of RSS reader doesn't iterate over different formats HOT 2
- PubSubHubbub/Publisher not sending requests to hubs
- Itunes categories with same main category are overwritten HOT 9
- Laminas-http mishandles multiple headers causing failure HOT 2
- feedLink() is broken, returns invalid data if not found HOT 3
- CRLF in vendor/laminas/laminas-feed/CHANGELOG.md HOT 5
- Add code example for feed-writer to add a media object via the enclosure element
- Dependency Dashboard
- Error 500 when rendering a feed with some set*() methods HOT 2
- Add support for laminas/laminas-servicemanager 4.0 so this library can be used on PHP 8.2 + psr/container 2.0. HOT 4
- DateTime::createFromFormat(): Argument #2 ($datetime) must be of type string, bool given HOT 1
- Laminas\Feed\Reader\ExtensionManagerInterface is said to be deprecated, but it still looks like to be required HOT 5
- DOMDocument::loadXML(): CData section too big found HOT 4
- Add PHP 8.4 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laminas-feed.