Channel plugins

The simplest kind of plugin is a channel plugin so we'll start with one of those. We'll write it in Python since it's very easy to see what's happening, even if you don't know the language.

Start Awasu, open the Channel Wizard and select the script file $/Samples/SamplePythonChannel/SamplePythonChannel.py (where $ stands for where you have installed Awasu e.g. C:\Program Files\Awasu). When you have finished going through the wizard, Awasu will call this script to generate a feed and show you the results.

The script looks like this:

HOME_URL = "http://www.test.com"
NFEEDITEMS = 10 

# generate the RSS feed 
print "<RSS>" 
print "<CHANNEL>" 
print 
print "<TITLE>Sample Python Channel</TITLE>" 
print "<LINK>" + HOME_URL + "</LINK>"
print "<DESCRIPTION>This is a dummy RSS feed generated by the sample Python channel plugin.</DESCRIPTION>" 
print 
for i in range(1,NFEEDITEMS+1) :
    print "<ITEM>" 
    print "    <TITLE>Item " + str(i) + "</TITLE>" 
    print "    <LINK>" + HOME_URL + "/item" + str(i) + ".html</LINK>" 
    print "    <DESCRIPTION>This is a dummy description for item " + str(i) + "</DESCRIPTION>" 
    print "</ITEM>" 
    print 
print "</CHANNEL>" 
print "</RSS>"
That's it! Plugins are simply required to print out their feed to the console and Awasu will take it from there. We won't go into the details of the exact format of an feed here but it's easy to see how things are organized. You will find an example feed in the Samples directory. Most of the time, you won't need anything more than this.

A few notes about how plugins are run: