我正在使用 PHP 构建一个 RSS 提要,并希望它在 iTunes 中很好地显示。
- 如何格式化 RSS 提要以便 iTunes 喜欢它?
- 有什么我应该使用的特殊标签吗?
- 将其提交到 iTunes 目录的最佳方式是什么(只需一次,或定期重新提交以保持“新鲜”)?
- 有哪些最佳做法、提示和技巧可以让提要在 iTunes Store 中脱颖而出?
RSS 提要的格式应与其他任何带有附件的格式一样。网络上有数百种资源描述了如何制作这样的提要。
这里告诉您 RSS 提要中所需的 iTunes 特定标签。
请注意,Apple 严重破坏了 iTunes 9 中的播客支持,因此如果它似乎无法正常工作,请不要气馁:这可能是 Apple 的错。
我为此创建了一个小型 PHP 库,您可以在此处找到它。
这是一个例子:
use iTunesPodcastFeed\Channel;
use iTunesPodcastFeed\FeedGenerator;
use iTunesPodcastFeed\Item;
require __DIR__ . '/vendor/autoload.php';
// SETUP CHANNEL
$title = 'Read2Me Daily Curated Articles';
$link = 'https://read2me.online';
$author = 'NYTimes and Medium';
$email = 'hello@read2me.online';
$image = 'https://d22fip447qchhd.cloudfront.net/api/widget/static/images/default-thumbnail.png';
$explicit = false;
$categories = [
'News',
'Technology',
'Culture',
'Entrepreneurship',
'Productivity'
];
$description = 'Daily curated articles from New York Times and Medium';
$lang = 'en';
$copyright = 'The New York Times Company and The Medium Company';
$ttl = 43200; // 12 hours in seconds
$channel = new Channel(
$title, $link, $author, $email,
$image, $explicit, $categories,
$description, $lang, $copyright, $ttl
);
// SETUP EPISODE
$title = "Trump Says Disclosure of Mueller Questions in Russia Probe Is ‘Disgraceful’";
$fileUrl = 'https://s3.read2me.online/audio/www-nytimes-com-2018-05-01-us-politics-trump-mueller-russia-questions-html-7e9601.mp3';
$duration = '2:18';
$description = 'WASHINGTON — President Trump on Tuesday said it was “disgraceful” that questions the special counsel would like to ask him were publicly disclosed, and he incorrectly noted that there were no questions about collusion. The president also said collusion was a “phony” crime.';
$date = 1525177808;
$filesize = 828387;
$mime = 'audio/mpeg';
$item = new Item(
$title, $fileUrl, $duration,
$description, $date, $filesize, $mime
);
$item2 = clone $item; // just to give you an idea of how it works
// SETUP FEED
$feed = new FeedGenerator($channel, ...[$item, $item2]);
// OUTPUT XML
header('Content-Type: application/xml; charset=utf-8');
print $feed->getXml();