Text


Hello, on this website you can find details about my PlayStation®Mobile games and apps.
- About Turn

Sunday 28 June 2015

Catch Up TV Film Guide - Advanced Customisation

Version v1.01 of Catch Up TV Film Guide has an advanced mode that allows you to write your own config to retrieve and display TV listings from many services. This article aims to tell you how to do this.



To enable Advanced Mode press the Menu button in the bottom right, followed by selecting Advanced Mode.

To update the config, open the Menu and select Update Config, enter a the URL to the config and wait it to be downloaded and processed. If all goes well tapping Refresh in the bottom left will display the TV listings.

If you don't have your own webspace a paste bin website with a "raw" download mode will do, http://pastebin.com/ works at the time of writing.

Here's the basic file format structure:
<AdvancedConfig>
  <IndexUrl>http://www.example.com/</IndexUrl>
  <UserAgent>Example</UserAgent>
  <IndexConfig/>
  <ShowConfig/>
  <EpisodeConfig/>
</AdvancedConfig>
The UserAgent field is optional. The IndexConfig, ShowConfig and EpisodeConfig blocks represent different levels of detail and all the follow the same format. The ShowConfig and EpisodeConfig are both optional. Here's the basic format:
<BeginMarkerRegex>EXAMPLE REGEX</BeginMarkerRegex>
<EndMarkerRegex>EXAMPLE REGEX</EndMarkerRegex>
<ParserConfig>
  <ContentConfigs>
    <ContentConfig>
      <ContentRegex>(.+)</ContentRegex>
      <GroupFieldTypes>
        <GroupFieldType>ItemName</GroupFieldType>
      </GroupFieldTypes>
    </ContentConfig>
  </ContentConfigs>
</ParserConfig>
Note, you will need to escape XML values (angle brackets, quotes and such in the regexes) to make it valid XML. You can use an online converter like http://www.htmlescape.net/htmlescape_tool.html for this.

The BeginMarkexRegex and EndMarkexRegex fields are optional and indicate the portion of the webpage to apply the ContentConfigs to.

Each ContentConfig block is 1 regular expression. You can have as many ContentConfig blocks as you like, together they represent a single content item. You'll want to use multiple ContentConfig blocks if the content name and link are in different parts of the page then. The content configs will be applied repeatedly until either the EndMarkerRegex or the end of the page is reached.

The GroupFieldType defines how to interpret the regular expression groups. The valid values are None, ItemName and ItemLink. Here's an example how you would use this:

Example webpage:
<a href="episode1.html">Episode 1</h1>
<a href="episode2.html">Episode 2</h1>
<a href="episode3.html">Episode 3</h1>
Example regex:
<a href=\"(.+)\">(.+)</h1>
Example partial config:
<ParserConfig>
  <ContentConfigs>
    <ContentConfig>
      <ContentRegex>&lt;a href=\&quot;(.+)\&quot;&gt;(.+)&lt;/h1&gt;</ContentRegex>
      <GroupFieldTypes>
        <GroupFieldType>ItemLink</GroupFieldType>
        <GroupFieldType>ItemName</GroupFieldType>
      </GroupFieldTypes>
    </ContentConfig>
  </ContentConfigs>
</ParserConfig>