This page demonstrates using DirectRSS to post to an RSS file and the template system to display it, creating a small weblog. (More generally, it could be used as an XML-RPC backend to any system that needed to log occasional events for display.)
To try it out, configure a weblog posting client, such as NetNewsWire (full version) or w.bloggar, with the following settings, which are correct for the sample site as it shipped. If there is a preset for “Radio Userland”, select that, and you will only have to change the port number and Blog ID.
Weblog API: | If there is a preset for Radio Userland, choose that. Otherwise, select as many of the following APIs as your software allows. First choice: MetaWeblog API Second choice: b2 API Third choice: Blogger API |
RPC URL: | http://127.0.0.1:8000/RPC2 |
Some tools separate the RPC URL into the following three fields: | |
Hostname: | 127.0.0.1 |
Path: | /RPC2 |
Port: | 8000 |
Username: | jdoe |
Password: | password |
Blog ID: | single-rss |
Home Page URL: | http://127.0.0.1:8000/cgi-bin/shearersite.py?path=/weblog/simple-rss/ |
Now you should be able to post to your weblog. (The home page URL setting just makes it easier to jump straight to the administration screen to update your pages.)
After making a posting, jump back into the template system through the Home Page URL link and click Update Pages. The template system will read the modified RSS file and pour the new content into your web page.
How this is done: a link in the head element of this page tells the system where to find the RSS file.
<link rel="alternate" type="application/rss+xml" title="weblog"
href="rss.xml">
(The title attribute is for reference later.) Then, where you want to include your weblog in the page, use the following code. It specifies a maximum count of 15 items, using data from the link tag titled "weblog", with typical weblog-item fields visible. (The "weblogitem" template shows everything including dates; you could also use "descriptions" to just show titles and descriptions, or "titles" to show just titles.)
<div id="template_rss_count_15_data_weblog_template_weblogitem">
</div>
And here is the result:
This is a test of the template system and DirectRSS publishing.
Just built this weblog today.