| Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2025-11-03 (Less than 1 hour ago)  | | Not yet rated by the users | | Total: Not yet counted | | Not yet ranked |
|
| Description | | Author |
This package can fetch and cache an RSS feed from a given URL.
It provides a class that can take a URL of an RSS feed and retrieves it using PHP's simplexml and cURL extensions, so it does not require PHP allow_url_fopen enabled to be set.
The class uses an HTTP user agent that is the same as the current user browser to avoid being blocked by content delivery network services such as CloudFlare that block robots.
The class can parse the RSS feed XML data and return a object with the RSS feed structure.
The RSS feed data can be stored in a local file in a given directory for a period of a given time length to avoid accessing the same RSS feed URL. Innovation Award
 July 2025
Winner |
RSS feeds let Websites share content in a way if it is easy to process by other sites because they use a standard format based on XML.
Websites usually use automated scripts that act like robots that retrieve and parse RSS feeds from other sites.
The increasing number of robots that are accessing Websites lead to content delivery services to block aggressive robots.
This package provides an RSS feed retrieving class that is friendly with other Websites and can avoid blocks from content delivery services that block robots.
Manuel Lemos |
| |
 |
|
Innovation award
 Nominee: 2x
Winner: 1x |
|
Instructions
Example
<?php include 'rssFetchXML.php'; ?>
<!doctype html>
<html lang="en">
<head>
<title>rssFetchXML Demo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="" />
<style>
<!--
html { font-size: 75%; font-family: verdana; }
h1 { padding: 5px; text-align: center; }
h3 { background: #eee; padding: 5px; }
p { background: #eef7fb; padding: 5px; margin: 5px; }
div { float: right; width: 30%; height: 400px;
overflow-y: scroll; background: #aaa; padding: 10px; margin: 10px; }
h4 { padding: 5px; text-align: center; }
-->
</style>
</head>
<body>
<header>
<!-- Begin header content -->
<h1>rssFetchXML Demo</h1>
<!-- End header content -->
</header>
<main>
<!-- Begin main content -->
<?php
$new = new rssFetchXML;
echo rss_feed( 'https://sports.yahoo.com/rss', $new );
echo rss_feed( 'https://www.stereogum.com/feed/', $new );
echo rss_feed( 'https://www.panthers.com/rss/news', $new );
echo rss_feed( 'https://www.tdpri.com/forums/-/index.rss', $new );
echo rss_feed( 'https://www.dailymail.co.uk/ushome/index.rss', $new );
echo rss_feed( 'https://stackoverflow.blog/feed/', $new );
?>
<!-- End main content -->
</main>
<footer>
<!-- Begin footer content -->
<h4>rssXmlFetch © 2025</h4>
<!-- End footer content -->
</footer>
</body>
</html>
<?php
function rss_feed( $url, $new ) {
$new->rss_xml_cache = 'cache';
$new->rss_xml_expire = 3600;
$rss = @$new->rss_xml_fetch($url);
$output = '';
if (is_object($rss)) {
$output .= '<div><h3><a href="' . $rss->channel->link . '" target="_blank">'. $rss->channel->title . '</a></h3>';
foreach ( $rss->channel->item as $item )
$output .= '<p><a href="'. $item->link .'" target="_blank" style="">' . $item->title . '</a></p>';
$output .= '</div>';
} else {
$output .= '<div>RSS fetch failed - RSS url or feed may be invalid</div>';
}
return $output;
}
|
Details
rssFetchXML
App: rssFetchXML
Version: 1.1
Author: MT Jordan <[email protected]>
Copyright: 2025
License: MIT License
*
rssFetchXML: RSS feed aggregator
rssFetchXML fetchs RSS feeds using a simple PHP class
*
rssFetchXML Features:
* Extremely compact code that simplifies hooking into projects utilizing
PHP's simplexml and cURL
* Does not require allow_url_fopen enabled
* Using simplexml with cURL sends "friendly" RSS requests that networks such
as Cloudflare may treat as bots with other methods
* Display unlimited RSS feeds with a single class instance
* Auto creates cached XML files
* Cache dir and cache expiration time set in script but can be overridden
on the client side
* See rssFetchXML_demo.php for examples
rssFetchXML Requirements:
* PHP 5.6+
* Enabled libxml extension
* Enabled cURL extension
*
| |
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.