Open MarkWieczorek opened 3 years ago
Thanks for the suggestion, sounds like a good idea although I'm not familiar with the opml files.
With the currently available features, the easiest way to import a large list of podcasts would be to use the occ
command podcast-add
. It can be used to import multiple channels with a single command using syntax like
php ./occ music:podcast-add your_user_name --rss=first_url --rss=second_url --rss=third_url
Thanks for the suggestion, sounds like a good idea although I'm not familiar with the opml files.
With the currently available features, the easiest way to import a large list of podcasts would be to use the
occ
commandpodcast-add
. It can be used to import multiple channels with a single command using syntax likephp ./occ music:podcast-add your_user_name --rss=first_url --rss=second_url --rss=third_url
` Great that there is such a possibility! I guess one has to understand how to properly extract URLs from an exported OPML in order to use this command for batch adding.
However, OPML is`the standard for interoperability between podcatcher and newsreader apps, so this is definitely a must.
I have not looked into this PHP app yet, but would this be somewhere to start?
https://packagist.org/packages/celd/opml-import-export
Import OPML file:
<?php
use Celd\Opml\Importer;
$importer = new Importer(file_get_contents('http://opml-url'));
$feedList = $importer->getFeedList();
foreach ($feedList->getItems() as $item) {
if ($item->getType() == 'category') {
echo $item->getTitle(); // Category title
foreach($item->getFeeds() as $feed) {
echo $feed->getTitle() . "\n";
}
}
echo $item->getTitle(); //Root feed title
}
// Properties of Model/Feed are:
// title, xmlUrl, htmlUrl, type (rss/atom/etc)
Exporting OPML file
<?php
use Celd\Opml\Importer;
use Celd\Opml\Model\FeedList;
use Celd\Opml\Model\Feeed;
$feedList = new FeedList();
$feed = new Feed();
$feed->setTitle('Feed title');
$feed->setXmlUrl('http://rss-feed-url');
$feed->setType('rss');
$feed->setHtmlUrl('http://html-url');
$feedList->addItem($feed);
$importer = new Importer();
echo $importer->export($feedList);
The music app is great, but at present you can only add one podcast at a time to your music library by manually typing in the url of an RSS feed. For those of us with extensive podcast collections, it would be very useful to allow us to import (and export) an entire collection using an opml file.