Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

RSS feed to html website

Options
  • 26-10-2007 11:40am
    #1
    Registered Users Posts: 1,695 ✭✭✭


    I have a bog standard .shtml website. I update a news column on another blog which has an RSS feed. Is there a way to make a page within my existing html website that will update automatically and show the news content when my blog news page does.


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    You can use Javascript to download the content of the RSS feed, parse it and display it on the page. Whenever a user accesses the page, the Javascript can download the latest content from your blog.


  • Registered Users Posts: 1,695 ✭✭✭dathi1


    Sounds good. I'll search see if there's a widget or raw script available to do this. thanks. :)


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    For the sake of cleanliness, just remember that a tiny proportion of visitors may not have javascript enabled. For these people, it may be worth displaying text like, "Because you have javascript disabled, you cannot see my blog :(. Click here to go directly to it".


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    If you have both sites on the same host, look into using PHP's (assuming thats what your blog is running on) XML parsing library to process the RSS file on the server side.


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi




  • Advertisement
  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Another way of dealing with such elements is to use javascript to display them. That way the don't show for the few without javascript enabled browsers.

    Wrap the rss display element in a div, set the div class to hide that div and in the page onload event or where ever call a function to change the div's class so it can be seen (as below). Javascript browsers will show the div, non javascript browsers won't. Its a personal preference really, I find <NOSCRIPT> ugly. You also may not want to use document.getElementById().

    [html]
    <HTML>
    <HEAD>
    <style type="text/css">
    div.rss-hide {
    display:none;
    }
    div.rss-show {
    display:block;
    }
    </style>
    <script type="text/javascript">
    function displayRss(){
    document.getElementById('rssFeed').className = 'rss-show';
    }
    </script>
    </HEAD>
    <BODY onload="displayRss();">

    <div id="rssFeed" class="rss-hide">
    <!-- RSS feed goes in here -->
    This is the rss feed.
    </div>
    </BODY>
    </HTML>
    [/html]

    <edit>Just noticed a typo.


  • Registered Users Posts: 4,468 ✭✭✭matt-dublin


    find out what server side scription your provider supports.

    it would be much easier and user friendly if it was server side


  • Closed Accounts Posts: 831 ✭✭✭Laslo


    find out what server side scription your provider supports.

    it would be much easier and user friendly if it was server side

    Precisely. It's much easier to do this with PHP (or ASP) and XSL and there are loads of examples online.


Advertisement