solved Rss Audio Reader Custom

serveion
@serveion
10 years ago
223 posts
Hello

I been trying to make a audio custom rss with feeds module where i can show all or fix number of new songs on the system,

am planing make a list from 100 to 300 track links, so i can later add to my autotweet where each feed will be a tweet. to help artist can be promoted by our website. but i try but i have no idea how to start,

thank you for your help.

ps when i open audio rss feed am getting this error I don't know how to fix it or start, I believe is the latin character within the xml but not sure, see attachment
updated by @serveion: 04/01/16 04:31:37AM
michael
@michael
10 years ago
7,772 posts
Take a look at the source code for that XML page. Firefox will usually highlight any errors it sees in red.

Hard to tell what the error is on just the screenshot.

XML is very picky when it comes to formatting. You need to escape the output so that it matches XML requirements.

That might be as easy as adding |jrCore_entity_string to the variables you use, or it might require more. need to do lots of testing.

eg:
{$title|jrCore_entity_string}
serveion
@serveion
10 years ago
223 posts
hello

am going to check this out and see where it leads me,
serveion
@serveion
10 years ago
223 posts
Quick question where should i add {$title|jrCore_entity_string} so i can test it,
serveion
@serveion
10 years ago
223 posts
hello

i found the problem the xml ger error when the titles gets & in my case

En Lo Oscuro Feat. Wisin & Yandel
is title the i was using, i change the & and the xml got fixed

who that helps

thank you
updated by @serveion: 12/23/15 03:20:19PM
michael
@michael
10 years ago
7,772 posts
right, so any of your users might put an & in there and thats a problem if its going to break the xml. So use |jrCore_entity_string on whatever variable outputs that title in your .tpl file.

If you can paste your .tpl rss code I can tell you which variable it is if your stuck.

Well done, good finding.
serveion
@serveion
10 years ago
223 posts
hello @michael

I don't have a custom file.tpl at them moment am testing Feed Module and testing them first. before i create my own,
am learning how jamroom works inside out and testing everything jamroom have to offer,

here is the feed module code:

url where I got the error are the follow

domain.com/feed/streams/don-omar

rss.tpl
<?xml version="1.0"?>
<rss version="2.0">
    <channel>
        <title>{$rss_title}</title>
        <description>{$rss_desc}</description>
        <link>{$rss_url}</link>
        <lastBuildDate>{$rss_builddate}</lastBuildDate>
        {foreach $_items as $item}
            <item>
                <title>{$item.title}</title>
                <link>{$item.link}</link>
                <description>{$item.description|jrCore_format_string:$item.profile_quota_id|strip_tags}</description>
                <pubDate>{$item.pubdate}</pubDate>
            </item>
        {/foreach}
    </channel>
</rss>
    

rss_list.tpl
{if isset($jrFeed.feed)}
    <div class="title"><h2>{$jrFeed.feed.title}</h2></div>
    <div class="block_content">
        <div class="item" style="height:462px;overflow:auto;">
            {if isset($jrFeed.feed.item)}
                {foreach from=$jrFeed.feed.item item="item"}
                    <div class="normal">
                        <a href="{$item.link}">{$item.title}</a><br>
                        {$item.pubDate|jrCore_date_format}<br>
                        {$item.description}<br>
                    </div>
                    <hr>
                {/foreach}
            {/if}
        </div>
    </div>
{/if}

Thank You
updated by @serveion: 12/23/15 08:23:24PM
michael
@michael
10 years ago
7,772 posts
If its running through the default I would have expected escaping.

Looks like the one's you'd want to change are:
{$item.title}
to
{$item.title|jrCore_entity_string}

It looks like the 'description' is having html stripped by the feed function.

But anywhere where stuff like that & is causing an issue |jrCore_entity_string should fix it.

--edit--
what its doing is it's taking & and turning it into & a m p ; (without the spaces)
updated by @michael: 12/23/15 08:44:33PM
serveion
@serveion
10 years ago
223 posts
Hello

i did try that but now am getting other error here is the msg

error on line 42 at column 49: Entity 'eacute' not defined

see attachment for the

i found this on stackoverflow

Your XML file is invalid, as É isn't a default character entity for XML documents.

You should to replace it by É or to correctly encode it.

thank you
updated by @serveion: 12/25/15 12:34:57AM
michael
@michael
10 years ago
7,772 posts
couple of discussions on XML and eacute here:
http://objectmix.com/csharp/729650-xml-character-codes-such-eacute%3B.html
http://p2p.wrox.com/xslt/41905-utf-8-xml-undeclared-entity-errors.html
http://stackoverflow.com/questions/13953222/xml-entities-not-defined-and-cdata

That last one has this suggestion:
Quote:
If you want to embed HTML in an XML document, then you either have to use:

* CDATA markers around the content of an element (not an attribute). (As you are doing for the value of the meta element)

So try:
<![CDATA[ {$item.title|jrCore_entity_string}  ]]>
serveion
@serveion
10 years ago
223 posts
Hello @michael

I have modify the rss.tpl on the feed module and it works perfectly,

here is how the code looks like now.
<?xml version="1.0"?>
<rss version="2.0">
    <channel>
        <title><![CDATA[ {$rss_item.title|jrCore_entity_string}]]></title>
        <description>{$rss_desc}</description>
        <link>{$rss_url}</link>
        <lastBuildDate>{$rss_builddate}</lastBuildDate>
        {foreach $_items as $item}
            <item>
                <title><![CDATA[ {$item.title|jrCore_entity_string}]]></title>
                <link>{$item.link}</link>
                <description><![CDATA[ {$item.description|jrCore_format_string:$item.profile_quota_id|strip_tags|jrCore_entity_string}]]></description>
                <pubDate>{$item.pubdate}</pubDate>
            </item>
        {/foreach}
    </channel>
</rss>

Thank you very Much.
updated by @serveion: 12/25/15 10:05:44PM

Tags