Web users demand content. Keeping the content of your site fresh requires a lot of time and effort and, unless you can afford to pay content developers to update your site, you're stuck maintaining content. In this solution, I'll show you how to integrate news feeds into your site dynamically using HTML, CSS, and JavaScript, thus freeing you from painstaking Web searches and manual updates.
A news feed is exactly what you think it isa file sitting in a public location from which you can read and display data on your site. News feed services usually generate these files by culling pertinent stories from a variety of sources. The good news is thatafter you've set up the news feed code, the news items update automaticallygetting the most current news no longer requires your intervention.
Problem: Users like news feeds, and they can increase traffic to your site, but the real trick is to implement them and avoid creating a maintenance nightmare. How can you implement a newsfeed generically, with reusable code?
Solution: Use the Model-View-Controller (MVC) architecture to minimizes the changes required to switch news feeds. This solution shows you how to switch news feeds by changing just a few lines of code.
Do you use a newsfeed service now? Did you think you had to create complicated script or use controls to implement newsfeeds in your site? Do you like this article's approach to implementing a newsfeed? Join the discussions at Web.dhtml.general and Web.dhtml.scripting to get answers, make comments, or help others with their problems.