代码之家  ›  专栏  ›  技术社区  ›  Candidasa

为iTunes制作播客RSS提要

  •  3
  • Candidasa  · 技术社区  · 17 年前

    我正在使用PHP构建一个RSS提要,并希望它能在iTunes中很好地显示出来。

    • 如何格式化RSS提要,以便iTunes喜欢它?
    • 有什么我应该使用的特殊标签吗?
    • 有哪些最佳实践、技巧和窍门可以让提要在iTunes Store中脱颖而出?
    2 回复  |  直到 8 年前
        1
  •  2
  •   j0k gauthamp    14 年前

    RSS提要的格式应该像其他带有附件的提要一样。网络上有数百个资源描述了如何制作这样的提要。

    这 here 告诉您RSS提要中所需的iTunes特定标签。

    请注意,苹果已经严重破坏了iTunes 9中的播客支持,所以如果它似乎不能正常工作,不要气馁:这可能是苹果的错。

        2
  •  0
  •   The Onin    8 年前

    here .

    这里有一个例子:

    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();
    
    推荐文章