定制 nr/processpodcastsubscriptions 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nr/processpodcastsubscriptions

Composer 安装命令:

composer require nr/processpodcastsubscriptions

包简介

Subscribe Podcast RSS feed and save as new page

README 文档

README

What it does

Subscribe to podcast RSS feeds and save the data as anything you want. The module uses the great PHP Library podcast-feed-parser by Lukas White, which makes processing the podcast data a breeze. Thanks!

The module comes with an example module ProcessPodcastSubscriptionsEpisodes to demonstrate how to create new pages per episode.

Features

  • Subscribe / Unsubscribe Podcast XML-Feeds
  • Periodically fetch feeds with LazyCron
  • Simple hookable actions
  • ProcessModule for administration
  • Optional module ProcessPodcastSubscriptionsEpisodes

Install

  1. Copy the files for this module to /site/modules/ProcessPodcastSubscriptions/
  2. Execute the following command in the /site/modules/ProcessPodcastSubscriptions/ directory.
    composer install
  3. If not done automatically, create a new admin page with the process ProcessPodcastSubscriptions
  4. Install the additional module ProcessPodcastSubscriptionsEpisodes (optional) or build your own processor
  5. Subscribe to Podcast feeds...

Install via composer

  1. Execute the following command in your website root directory.
    composer require nr/processpodcastsubscriptions

Configuration Subscriptions

Modules > Configure > ProcessPodcastSubscriptions

Lazycron

Setup the LazyCron schedule. The cache expiration is configurable in the field settings.

Lazycron

Episode Meta

You can add subscribe links to the podcast. Configure the providers and then attach the links to the podcast.

Episode Parent

Configuration Episodes

Modules > Configure > ProcessPodcastSubscriptionsEpisodes

Episode Parent

Set parent page for new episode pages.

Episode Parent

Podcast Class and Episode Class

The Podcast object has a lot of handy methods to do anything you want with the returned data.

class Podcast implements HasArtwork {
   
   public array getEpisodes()
   public string getLanguage()
   public string getAuthor()
   public string getTitle()
   public string getSubtitle()
   public string getDescription()
   public DateTime getLastBuildDate()
   
   public string getType()
   public bool isEpisodic()
   public bool isSerial()
   
   public string getUpdatePeriod()
   public Artwork getArtwork()
   public string getExplicit()
   public array getCategories()
   
   /* ... and much more ... */
}
class Episode {

    public string getGuid()
    public int getEpisodeNumber()
    public Media getMedia()
    public DateTime getPublishedDate()
    public string getTitle()
    public string getDescription()
    public Artwork getArtwork()
    public string getLink()
    public string getExplicit()
    
    /* ... and much more ... */
}

Hook

// init.php or ready.php
$wire->addHookBefore('ProcessPodcastSubscriptions::processPodcast', function (HookEvent $event) {

    /** @var \ProcessWire\WireData $feed */
    $feed = $event->arguments(0);

    /** @var \Lukaswhite\PodcastFeedParser\Podcast $podcast */
    $podcast = $event->arguments(1);
    
    // process
    foreach($podcast->getEpisodes() as $episode) {
        /* create or update episode pages... */
    }

});

Example Rendering

In the folder ProcessPodcastSubscriptions/templates/podcasts-example.php you will find a sample rendering for a podcast and episode list. Have fun with it.

Episode Parent

Todos

  • Respect lastBuildDate from feed for update action.
  • Handle long running script on subscribe.

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固