how to place Rss feed in an HTML page?

Asked

Viewed 2,196 times

1

Look at the website.

Free RSS Widget

I have the following code;

<!-- start sw-rss-feed code --> 
<script type="text/javascript"> 
<!-- 
rssfeed_url = new Array(); 
rssfeed_url[0]="http://esporte.uol.com.br/ultimas/index.xml";  
rssfeed_frame_width="300"; 
rssfeed_frame_height="260"; 
rssfeed_scroll="on"; 
rssfeed_scroll_step="6"; 
rssfeed_scroll_bar="off"; 
rssfeed_target="_blank"; 
rssfeed_font_size="12"; 
rssfeed_font_face=""; 
rssfeed_border="on"; 
rssfeed_css_url=""; 
rssfeed_title="on"; 
rssfeed_title_name=""; 
rssfeed_title_bgcolor="#3366ff"; 
rssfeed_title_color="#fff"; 
rssfeed_title_bgimage=""; 
rssfeed_footer="off"; 
rssfeed_footer_name="rss feed"; 
rssfeed_footer_bgcolor="#fff"; 
rssfeed_footer_color="#333"; 
rssfeed_footer_bgimage=""; 
rssfeed_item_title_length="50"; 
rssfeed_item_title_color="#666"; 
rssfeed_item_bgcolor="#fff"; 
rssfeed_item_bgimage=""; 
rssfeed_item_border_bottom="on"; 
rssfeed_item_source_icon="off"; 
rssfeed_item_date="off"; 
rssfeed_item_description="on"; 
rssfeed_item_description_length="120"; 
rssfeed_item_description_color="#666"; 
rssfeed_item_description_link_color="#333"; 
rssfeed_item_description_tag="off"; 
rssfeed_no_items="0"; 
rssfeed_cache = "e90320463f8111afd3b519c711ff89e3"; 
//--> 
</script> 
<script type="text/javascript" src="//feed.surfing-waves.com/js/rss-feed.js"></script> 
<!-- The link below helps keep this service FREE, and helps other people find the SW widget. Please be cool and keep it! Thanks. --> 
<div style="text-align:right; width:300px;">powered by <a href="http://www.surfing-waves.com" rel="noopener" target="_blank" style="color:#ccc;font-size:10px">Surfing Waves</a></div> 
<!-- end sw-rss-feed code -->

How do I view this news on an HTML page?

1 answer

1


Just import the scripts into the header of its HTML and the div within the body, follows the code of an HTML page loading the feed:

<html>
    <head>
        <title>Titulo da página</title>
        <meta charset="utf-8">
        <script type="text/javascript"> 
            rssfeed_url = new Array(); 
            rssfeed_url[0]="http://esporte.uol.com.br/ultimas/index.xml";  
            rssfeed_frame_width="300"; 
            rssfeed_frame_height="260"; 
            rssfeed_scroll="on"; 
            rssfeed_scroll_step="6"; 
            rssfeed_scroll_bar="off"; 
            rssfeed_target="_blank"; 
            rssfeed_font_size="12"; 
            rssfeed_font_face=""; 
            rssfeed_border="on"; 
            rssfeed_css_url=""; 
            rssfeed_title="on"; 
            rssfeed_title_name=""; 
            rssfeed_title_bgcolor="#3366ff"; 
            rssfeed_title_color="#fff"; 
            rssfeed_title_bgimage=""; 
            rssfeed_footer="off"; 
            rssfeed_footer_name="rss feed"; 
            rssfeed_footer_bgcolor="#fff"; 
            rssfeed_footer_color="#333"; 
            rssfeed_footer_bgimage=""; 
            rssfeed_item_title_length="50"; 
            rssfeed_item_title_color="#666"; 
            rssfeed_item_bgcolor="#fff"; 
            rssfeed_item_bgimage=""; 
            rssfeed_item_border_bottom="on"; 
            rssfeed_item_source_icon="off"; 
            rssfeed_item_date="off"; 
            rssfeed_item_description="on"; 
            rssfeed_item_description_length="120"; 
            rssfeed_item_description_color="#666"; 
            rssfeed_item_description_link_color="#333"; 
            rssfeed_item_description_tag="off"; 
            rssfeed_no_items="0"; 
            rssfeed_cache = "e90320463f8111afd3b519c711ff89e3"; 
        </script> 

        <script type="text/javascript" src="https://feed.surfing-waves.com/js/rss-feed.js"></script> 

    </head>

    <body>
        <div style="text-align:right; width:300px;">powered by <a href="http://www.surfing-waves.com" rel="noopener" target="_blank" style="color:#ccc;font-size:10px">Surfing Waves</a></div> 
    </body>
</html>

In Script import via CDN I removed the "//" and inserted "https://" because only thus it worked locally here, and it will work anywhere too.

  • it worked on html, but it didn’t work on angular 4, but that’s okay.

  • @wladyband I don’t know much about Angular 4 I don’t know how it works but I can help you because using ASP.NET probably the structure is similar, edit the question with the angular code of this screen you will add the feed I see if I can help you too.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.