/kbcs-app-customizations

WordPress plugin that provides additional feed functionality that pulls from the PlaylistCenter API

Primary LanguagePHP

KBCS App Customizations Plugin

This plugin provides two pieces of functionality needed for the KBCS iOS app.

##Plugin configuration

Configuration values for the plugin can be set in the kbcs-config.php file. Values of note that can be configured:

  • Cron job name
  • Cron job interval
  • Cron job interval name
  • Feed endpoint/slug
  • Show page URL/slug
  • Program categories for which to generate aggregate feed WordPress cache objects

##Custom feeds

The plugin provides for custom Wordpress feeds which utilize the Playlist Center API. The custom feeds integrate show/episode information from the Playlist Center with program information from the KBCS Wordpress website.

The plugin adds a default additional feed endpoint which can currently be used in two scenarios. The default endpoint is shows, though this can be changed in the config (kbcs-config.php).

Program feed

Program type aggregate feed

Note: Be wary of usage. This feed is weird to generate as there is currently not a way in the Playlist Center API to pull program show information in aggregate. This feed does its best version of it by getting the last 20 shows for each program, aggregating all those items, sorting, then slicing off the number requested. As it is not a true aggregate, be cautious of using results past the first 40-60.

Customizable options

Item count

An additional request parameter of itemCount and value can be added to the URL to alter the number of returned items in the feed.

If this parameter/value is not provided, the feed will return the default number of items as set in the WordPress site options.

Paging

Available only for program type aggregate feed. An additional request parameter of page and value can be added to the URL

If this parameter/value is not provided, the feed will by default return the first x number of results (as defined by default or provided itemCount).

Single show URL/page

The plugin provides for serving a page specific to a single program show/episode. This page is used within the iOS app to display information about a show. As such, it is expected to be used in a mobile/tablet device context and is not for use within the greater KBCS website. The default show page URL/slug is show-page, though this can be configured in kbcs-config.php.

##Functionality

###General

  • Provides valid feeds with properly encoded text (as applicable)
  • Feeds are in reverse chronological order (i.e. newest show first)
  • Airings that have not completed are not included in feeds
  • If it exists, the WP title for a program will be used instead of the title from the PlaylistCenter API

###Aggregate program type feed

  • Provides a feed for a KBCS WordPress program type
  • By default returns the WP default number of feed items
  • Accepts itemCount parameter to override WP default
  • Accepts page parameter
  • Rebroadcast shows are included

###Single program feed

  • Provides a feed for a KBCS WordPress program
  • By default returns the WP default number of feed items
  • Accepts itemCount parameter to override WP default
  • Should not include rebroadcast shows if WP is set up correctly (i.e. all programs, regardless of whether a rebroadcast, should have a unique program ID in the PlaylistCenter that is mapped to a single program in WP)

###Single show page

  • Provides info for single show
  • Page is responsive, built to be used in mobile app context

###Known issues

  • Aggregate feed results may be unreliable after a certain number (40-60?) because of the way it must be generated since there is currently not a way in the Playlist Center API to pull program show information in aggregate. This feed does its best version of it by getting the last 20 shows for each program for a given type, aggregating all those items, sorting, then slicing off the number requested.