| Recommend this page to a friend! |
| Info | Reputation | Support forum | Blog | Links |
| Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
| 2026-08-08 (Yesterday) | Not yet rated by the users | Total: Not yet counted | Not yet ranked | |||||
| Version | License | PHP version | Categories | |||
| rssfetchxml 1.3.1 | MIT/X Consortium ... | 7.2 | XML, PHP 5, Web services |
Please check this example script to learn how to retrieve, parse and cache RSS feeds of site contents.
<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --> <a id="readme-top"></a>
<h3 align="center">rssFetchXml</h3>
<p align="center">
rssFetchXml is an RSS and Atom reader that uses PHP, Javascript and HTML to display XML feeds
<br />
<a href="https://github.com/github_username/repo_name">View Demo</a>
</p> </div>
<!-- TABLE OF CONTENTS --> <details> <summary>Table of Contents</summary> <ol>
<li>
<a href="#about-the-project">About The Project</a>
<ul>
<li><a href="#built-with">Built With</a></li>
</ul>
</li>
<li>
<a href="#getting-started">Getting Started</a>
<ul>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#installation">Installation</a></li>
</ul>
</li>
<li><a href="#usage">Usage</a></li>
<li><a href="#license">License</a></li>
<li><a href="#contact">Contact</a></li>
</ol> </details>
<!-- ABOUT THE PROJECT -->
<b>rssFetchXml Features:</b>
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- GETTING STARTED -->
Open `rss_config.php` and edit the following variables
return [
"cache_dir" => "path/to/cache/", //Path to cache dir
"cache_expire" => 3600, //Cache expire in secs - ie: 3600 = 1 hr
"rss_error" => "RSS fetch failed - RSS Url or feed may be unavailable", //Custom error message on feed failure
"rss_max" => 12 //Max number of links displayed
];
Open `rss_fetch.js` and edit the following variable
let rssUrl = "https://somesite.com/rss/rssFetchXml.php";
Add `rss_fetch.js` script link to your HTML template right before the closing `</body>` tag
<script src="https://somesite.com/rss/rss_fetch.js"></script>
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- USAGE EXAMPLES -->
Add an empty HTML div where you want to display the RSS feed. Set its class as `rss-feed` and the data attribute `data-rss` value as the RSS feed URL.
<div class="rss-feed" data-rss="https://somesite.com/rss/feeds/feed.xml"></div>
This will return a HTML formatted block with the following structure:
<div class="rss-feed" data-rss="https://somesite.com/rss/feeds/feed.xml">
<div class="rss-header"><a href="https://somesite.com/" target="_blank">Channel Title</a></div>
<div class="rss-wrapper">
<div class="rss-link"><a href="https://somesite.com/item.html" target="_blank">Item 1 Title</a></div>
<div class="rss-link"><a href="https://somesite.com/item2.html" target="_blank">Item 2 Title</a></div>
<div class="rss-link"><a href="https://somesite.com/item3.html" target="_blank">Item 3 Title</a></div>
</div>
</div>
Add the following CSS properties to your CSS file to format your feed
.rss-feed {
padding: .5rem;
background-color: #fff;
border: .063rem solid #aaa;
}
.rss-header {
padding: .5rem;
}
.rss-header a {
font-weight: bold;
padding: .5rem;
color: #000;
text-decoration: none;
}
.rss-wrapper {
height: 10rem;
overflow-x: hidden;
overflow-y: scroll;
padding: .5rem;
}
.rss-link a {
text-decoration: none;
}
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- TROUBLESHOOTING -->
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LICENSE -->
Distributed under the MIT license. See LICENSE.txt for more information.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- CONTACT -->
Mike Jordan: mtjo62@gmail.com
Project Link: https://github.com/mtjo62/rssFetchXml
<p align="right">(<a href="#readme-top">back to top</a>)</p>
| File | Role | Description |
|---|---|---|
| Data | Auxiliary data | |
| Doc. | Documentation | |
| Lic. | License text | |
| Doc. | Documentation | |
| Class | Class source | |
| Aux. | Configuration script | |
| Data | Auxiliary data |
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
| Version Control | Unique User Downloads | |||||||
| 100% |
|
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.