jquery-rss
jquery-rss copied to clipboard
Can't get <enclosure> working in validated feed
Hi every one and first off thank you sdepold for this feed. It basically rocks!
However I have a problem getting the
From what I understand jquery.rss is looking for <img> tags within entry.content.
In the case of this feed the images I need are within an <enclosure> tag outside of entry.content.
If you take a look at the feed in your browser, you can clearly see them.
If I print out (JSON.stringify(this.feed));however, there seems to be no enclosure at all:
{
"feedUrl":"http://rss.filmstarts.de/fs/kinos/aktuelle",
"title":"Alle aktuellen Filme im Kino","link":"http://www.filmstarts.de",
"description":"Alle aktuellen Filme im Kino",
"author":"",
"entries":[{
"title":"The Jungle Book",
"link":"http://rss.filmstarts.de/~r/fs/kinos/aktuelle/~3/N1tIBsVws9U/222692.html",
"content":"<p>Abenteuer (106 Minuten) - Der junge Mogli (Neel Sethi) ist nach einem Zwischenfall von seiner Familie getrennt und von nun an alleine im indischen Dschungel unterwegs. Er findet schon bald Zuflucht bei der Wolfsmutter Rakcha (Stimme: Lupita Nyong'o), die ihn als eines ihrer Kinder aufzieht. Allerdings hat es Schir Khan (Idris...</p><p>Ein Film von <a href='http://www.filmstarts.de/personen/2108-Jon-Favreau.html' title='Jon Favreau'>Jon Favreau</a><br>Mit <a href='http://www.filmstarts.de/personen/693797.html' title='Neel Sethi'>Neel Sethi</a>, <a href='http://www.filmstarts.de/personen/183-Joachim-Kr%c3%b3l.html' title='Joachim Krol'>Joachim Krol</a>, <a href='http://w...://www.filmstarts.de/kritiken/232837/userkritiken/\">Zuschauer</a> : <a href=\"http://www.filmstarts.de/kritiken/232837/userkritiken/\"><img border=\"0\" src=\"http://de.web.img1.acsta.net/commons/rss/note_small_35.png\" alt=\"3.5\" /></a></p><p>>> <a href=\"http://www.filmstarts.de/kritiken/232837.html\">Vollständige Filmseite</a> | <a href=\"http://www.filmstarts.de/kritiken/232837/kinoprogramm/\">Showtimes of the 181 cinemas</a> | <a href=\"http://www.filmstarts.de/kritiken/232837/trailer/19551596.html\">Trailer</a> | <a href=\"http://www.filmstarts.de/kritiken/232837/bilder.html\">Bilder</a> | auf <i><a href=\"http://www.filmstarts.de\">Filmstarts</a></i></p><img src=\"http://feeds.feedburner.com/~r/fs/kinos/aktuelle/~4/z691kOohiGU\" height=\"1\" width=\"1\" alt=\"\"/>",
"contentSnippet":"Action (94 Minuten) - Das Moskau der Zukunft: Henry stand an der Schwelle zwischen Leben und Tod, seine Frau Estelle (",
"publishedDate":"2016-04-28T22:00:00.000Z",
"categories":[],
"author":""}
]}
Any idea how I get the right images shown?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Have you found a solution for that?
I ended up using jquery to get to the enclosure media so I'll paste that JS to hopefully/maybe help others or point in a possible direction...
`var rssurl = 'http://nerdist.libsyn.com/rss'; $.get(rssurl, function(data) { var $xml = $(data); var i = 0; var howMany = 10; i = 0; $xml.find("item").each(function() {
if(i<howMany){
$this = $(this),
item = {
title: $this.find("title").text(),
link: $this.find("link").text(),
description: $this.find("description").text(),
pubDate: $this.find("pubDate").text(),
author: $this.find("author").text(),
media: $this.find("enclosure").attr('url')
//image: $this.find("itunes:image").attr('url')
}
/*if(i<1){
$('#rss-image').append('<image src="'+item.image+'" /><br/>');
}*/
$('#rss-feeds').append('<h1>'+item.title+'</h1><i>'+item.description+'</i><audio src="'+item.media+'" controls></audio><br/>');
i++;
}
});
});`
Sou you parsed it via jQuery and not with the plugin anymore? Thanks for your time and support!
Yeah I wasn't sure if I should share but I couldn't seem to get to the enclosure's attributes either but that fit my small use case. If I get time I'd like to try to use the plugin and alter it if need be but that's another option in a pinch.
Back in 2007 i started a project to create some kind of "screensaver in the cloud" via the www.seemiyah.com website. One of my main visions was to show fullscreen RSS feeds. What i encountered was that 9 out of 10 professional companies (newspapers, magazines, tv stations etc.) simply ignored the RSS w3 recomendations. Some insert images inside the item-description whilst others use their own image text and even others do it correctly via the enclosure tag. I had to use a php switch statement to check what kind of image was used. What a hazzle :( Thanks for your time and support dubyajaysmith !