Awasu API: Channels

The Awasu API has been extended to allow channels to be created, updated and deleted.

The format of the configuration data used to create and update channels is the same as that returned by a $/channels/list request, except that there is no top-level <channels> node. For example, the following POST request sent to $/channels/create will create a new channel:

    <channel type="standard">
        <feedUrl> http://awasu.com/news.xml </feedUrl>
    </channel>

 

Channel type

The type of channel is configured via the channel@type attribute:

  • To create a normal channel, simply specify the feed URL e.g.
        <channel type="standard">
            <feedUrl> http://awasu.com/news.xml </feedUrl>
        </channel>
    
  • To create a plugin channel, specify the path to the plugin and optionally, any plugin parameter values e.g.
        <channel type="plugin">
            <pluginChannel path="{:INSTALL-DIR:}/Samples/SamplePythonChannel2/SamplePythonChannel2.py">
                <param name="nItems"> 3 </param>
            </pluginChannel>
        </channel>
    
  • To create a search channel, specify the query string and any other parameters e.g.
        <channel type="search">
            <searchQuery searchInUrls="no" searchInTitles="yes" searchInDescriptions="yes">
                query string
                <scoreCutoff> 25 </scoreCutoff>
            </searchQuery>
        </channel>
    

 

Channel configuration

Most channel configuration is fairly straight-forward and values are configured via child nodes in the root <channel> node.

Basic channel details such as its name and description are usually specified by the publisher in the feed itself but can be overriden by the user e.g.

    <channel type="standard">
        <name> ... </name>
        <description> ... </description>
        <homeUrl> ... </homeUrl>
    </channel>

The channel summary page can be configured like this:

    <channel type="...">
        <channelSummary compact="no" showItems="..." itemWindow="..." contentFormat="..."> 
            <templateFilename> {:INSTALL-DIR:}/Resources/Channel Summary Templates/Rusty.template </templateFilename>
        </channelSummary>
    </channel>
where:
  • showItems must be one of Default ; All ; Unread ; New
  • itemWindow is either a number of items to show (negative values) or a number of days to go back (positive values)
  • contentFormat must be one of Default ; Full ; Excerpt ; PlainText ; None

 

Feed authentication

The username and/or password can be set for channels as follows:

    <channel type="standard">
        <auth>
            <name> ... </name>
            <password> ... </password>
        </auth>
    </channel>

To remove the authentication details from a channel, include an empty <auth> node:

    <channel type="standard">
        <auth />
    </channel>

 

Channel hooks

Channel hooks can be added to new or existing channels as follows:

    <channel type="...">
        <channelHook path="...">
            <param name="..."> ... </param> <!-- include as needed -->
        </channelHook>
    </channel>

To update a hook that has already been attached to a channel, it must be identified by its ID. The hook itself cannot be changed and so only the display name and/or hook parameters may be altered.

To detach a hook from a channel, include a delete="yes" attribute e.g.

    <channel type="...">
        <channelHook id="..." delete="yes" />
    </channel>

 

Directory aliases

Any settings that include a directory path (e.g. template filename or output filename) can use one of the following directory aliases: