Article focus on a way how to generate RSS XML code for syndication news about currently published articles. User can subscribe for obtaining news about currently posted articles into a RSS readers.
RSS short introduction
RSS (RDF Site Summary or Really Simple Syndication)[2] is a web feed[3] that allows users and applications to access updates to websites in a standardized, computer-readable format. (wikipedia, 26.12.2020)
By creating RSS feed, we enable to other people gain info about all of our new post. Our goal is to populate newsfeed from the bazaar_item database table to inform about new items available for sell.
To view an RSS feed, users need a RSS newsreader. Some of them are integrated in most of today browsers.
Closer look at RSS
RSS uses as a HTML markup language that uses tags and attributes for content description. Base of RSS is then XML used to describe web content for syndication.
Next picture show output of generated RSS code for advertising new items on our Bazaar app.
Required tags for the channel
title. The title of the channel. Should contains the name.
link. URL of the website that provides this channel.
description. Summary of what the provider is.
one item tag at least, for the content.
1
2
3
4
5
6
7
8
9
10
<rssversion="2.0">
<channel>
<title>XUL</title>
<link>https://www.link.domain</link>
<description></description>
<item>
...
</item>
</channel>
</rss>
Script rss.php for RSS markup generation
Next code provide all functionality for obtaining data about items for sell and generate RSS XML syndication feed for subscribed users.
<a class=“navbar-brand“ href=“https://cdesigner.eu“> Visit us on CDesigner.eu </a>
<a class=“navbar-brand“ href=“rss.php“> Subscribe to newsfeed <img src=“./images/rss.png“ width=“25″> </a>
</div>
</div>
–>
In our pages is this footer script invoked way as can be visible on next code snippet. After including with requireonce() is invoked function for generating footer with expected with.
… code omitted from index.php …
<?php // footer include code
require_once(‚footer.php‘); // including footer
generate_footer(1060); // function from footer.php for seting width, you can use 580 and 1060px width
?>
</body>
</html>
Conclusion
With RSS syndication is opened new way for our users to subscribe for getting all new info about products for sell. Short example provide shor introduction to RSS generation and how to implement RSS generator into a code of our page.
Full Bazaar app code for further reference can be obtained from github here.
We inform you that we use cookies and other technologies on this site to function and improve the operation of the site, ensure it, provide social networking features, personalize content and ads to users, and analyze traffic and user behavior. For more information, please read our Terms of Use and Cookies. You can prevent cookies from being processed by changing the settings in your Internet browser.OkPrivacy policy