PHP RSS Feed Library
with Real-Time WebSub

Production-ready PHP library for real-time RSS/Atom feed management. Get updates in under 1 second with WebSub push notifications.

99% fewer HTTP requests with WebSub
Updates in <1 second (vs 15min polling)
Production-ready security & scalability
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');

Why HuntFeed?

Modern feed management for PHP developers

Real-Time Updates

WebSub (PubSubHubbub) support for push notifications. Get updates instantly instead of inefficient polling.

High Performance

99% fewer HTTP requests, 98% bandwidth reduction, 150x faster updates than traditional polling.

Multi-Format Support

Parse RSS 2.0, Atom 1.0, JSON Feed, RDF, GeoRSS. Export to 7 different formats.

Production Ready

HMAC-SHA1 verification, SSL enforcement, duplicate detection, and comprehensive error handling.

Smart Detection

Auto-detect feed formats, duplicate prevention with 3 fingerprinting strategies.

Easy Integration

Simple API, event-driven architecture, ready for Telegram bots, REST APIs, databases.

Get Started in Minutes

Installation is simple with Composer

composer require hosseinhunta/huntfeed

Basic Usage

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');

Requirements

PHP 8.1+

Modern PHP features and performance

cURL Extension

For HTTP requests

SimpleXML

For XML feed parsing

JSON Extension

For JSON feed support

Performance Comparison

HTTP Requests Polling: 9,600/day vs WebSub: ~100/day
Bandwidth Polling: 5 MB/day vs WebSub: 100 KB/day
Update Latency Polling: 15 minutes vs WebSub: <1 second

Use Cases & Examples

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()
    ]);
}

API Reference

Clean, intuitive API for developers

FeedManager

  • registerFeed($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

WebSubManager

  • registerFeedWithWebSub($id, $url) - Register with WebSub hub
  • setAutoSubscribe($enabled) - Auto-subscribe to hubs
  • setFallbackToPolling($enabled) - Enable polling fallback
  • getSubscriptionStatus() - Check subscription status

Events

  • feed:registered - New feed registered
  • feed:updated - Feed content updated
  • item:new - New item detected
  • item:duplicate - Duplicate item detected

Frequently Asked Questions

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.