Production-ready PHP library for real-time RSS/Atom feed management. Get updates in under 1 second with WebSub push notifications.
use Hosseinhunta\Huntfeed\Hub\FeedManager;
// Initialize
$manager = new FeedManager();
// Register feed with WebSub
$manager->registerFeed('tech', 'https://news.ycombinator.com/rss');
// Handle real-time updates
$manager->on('item:new', function($data) {
// Send notifications instantly
sendNotification($data['item']);
});
// Export in multiple formats
$json = $manager->export('json');
$rss = $manager->export('rss');
Modern feed management for PHP developers
WebSub (PubSubHubbub) support for push notifications. Get updates instantly instead of inefficient polling.
99% fewer HTTP requests, 98% bandwidth reduction, 150x faster updates than traditional polling.
Parse RSS 2.0, Atom 1.0, JSON Feed, RDF, GeoRSS. Export to 7 different formats.
HMAC-SHA1 verification, SSL enforcement, duplicate detection, and comprehensive error handling.
Auto-detect feed formats, duplicate prevention with 3 fingerprinting strategies.
Simple API, event-driven architecture, ready for Telegram bots, REST APIs, databases.
Installation is simple with Composer
composer require hosseinhunta/huntfeed
require 'vendor/autoload.php';
use Hosseinhunta\Huntfeed\Hub\FeedManager;
$manager = new FeedManager();
$manager->registerFeed('tech', 'https://news.ycombinator.com/rss');
// Get updates
$updates = $manager->checkUpdates();
// Export as JSON
echo $manager->export('json');
Modern PHP features and performance
For HTTP requests
For XML feed parsing
For JSON feed support
Integrate HuntFeed into your applications
// Telegram Bot Integration
$manager->on('item:new', function($data) {
$item = $data['item'];
$message = "📰 *New Article Alert!*\n\n";
$message .= "**{$item->title}**\n\n";
$message .= "{$item->link}\n\n";
$message .= "Published: " . $item->publishedAt->format('Y-m-d H:i');
// Send to Telegram
sendTelegramMessage($chatId, $message, 'Markdown');
});
// REST API Endpoint
$app->get('/api/feeds', function() use ($manager) {
header('Content-Type: application/json');
echo $manager->export('json');
});
$app->get('/api/feeds/{id}/rss', function($id) use ($manager) {
header('Content-Type: application/rss+xml');
echo $manager->export('rss', $id);
});
// WebSub Setup
use Hosseinhunta\Huntfeed\WebSub\WebSubManager;
$webSubManager = new WebSubManager(
$manager,
'https://your-domain.com/websub-callback.php'
);
$webSubManager->setAutoSubscribe(true);
$webSubManager->registerFeedWithWebSub(
'tech_news',
'https://example.com/feed.xml'
);
// Database Integration
$items = $manager->getAllItems();
foreach ($items as $item) {
$db->insert('articles', [
'title' => $item->title,
'content' => $item->content,
'url' => $item->link,
'published_at' => $item->publishedAt,
'category' => $item->category,
'fingerprint' => $item->fingerprint()
]);
}
Clean, intuitive API for developers
FeedManagerregisterFeed($id, $url, $options = []) - Register a single feed
registerFeeds(array $feeds) - Register multiple feeds
checkUpdates() - Check for new items
export($format, $feedId = null) - Export feeds in various formats
on($event, $callback) - Register event handlers
getLatestItems($limit = 10) - Get latest items across feeds
searchItems($query) - Search across all feeds
WebSubManagerregisterFeedWithWebSub($id, $url) - Register with WebSub hub
setAutoSubscribe($enabled) - Auto-subscribe to hubs
setFallbackToPolling($enabled) - Enable polling fallback
getSubscriptionStatus() - Check subscription status
feed:registered - New feed registered
feed:updated - Feed content updated
item:new - New item detected
item:duplicate - Duplicate item detected
HuntFeed is a production-ready PHP RSS/Atom feed management library with built-in WebSub (PubSubHubbub) support for real-time updates.
WebSub allows feed publishers to push updates to subscribers instantly, eliminating the need for constant polling and reducing server load.
Yes, HuntFeed offers all SimplePie features plus real-time WebSub support, better performance, and modern PHP 8.1+ architecture.
Absolutely. HuntFeed includes HMAC verification, duplicate detection, error handling, and is used in production environments.
HuntFeed requires PHP 8.1 or higher, taking advantage of modern PHP features for better performance and security.
HuntFeed reduces HTTP requests by 99%, bandwidth usage by 98%, and delivers updates in under 1 second compared to 15-minute polling intervals.