miniflux-legacy/vendor/fguillot/picofeed/docs/opml-export.markdown

899 B

OPML export

Example with no categories

use PicoFeed\Serialization\Export;

$feeds = array(
    array(
        'title' => 'Site title',
        'description' => 'Optional description',
        'site_url' => 'http://petitcodeur.fr/',
        'site_feed' => 'http://petitcodeur.fr/feed.xml'
    )
);

$export = new Export($feeds);
$opml = $export->execute();

echo $opml; // XML content

Example with categories

use PicoFeed\Serialization\Export;

$feeds = array(
    'my category' => array(
        array(
            'title' => 'Site title',
            'description' => 'Optional description',
            'site_url' => 'http://petitcodeur.fr/',
            'site_feed' => 'http://petitcodeur.fr/feed.xml'
        )
    )
);

$export = new Export($feeds);
$opml = $export->execute();

echo $opml; // XML content