Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.weblog.writeRsdFile
on writeRsdFile (f, adrblog=radio.weblog.init ()) {
<<Changes
<<12/18/02; 7:23:05 AM by DW
<<Update to bring into compliance with 1.0 format.
<<http://archipelago.phrasewise.com/stories/storyReader$1486
<<12/13/02; 8:56:02 AM by DW
<<Created.
<<Spec: http://archipelago.phrasewise.com/rsd
<<Example: http://archipelago.phrasewise.com/stories/storyReader$1368
local (xmltext = "", indentlevel = 0);
on add (s) {
xmltext = xmltext + string.filledstring ("\t", indentlevel) + s + "\r\n"};
on encode (s) {
if system.environment.isMac { //02/22/2001 JES: convert to Latin text
return (xml.entityEncode (latinToMac.macToLatin (s), true))}
else {
return (xml.entityEncode (s, true))}};
add ("<?xml version=\"1.0\"?>");
add ("<rsd version=\"1.0\" xmlns=\"http://archipelago.phrasewise.com/rsd\" >");
add ("<service>"); indentlevel++;
add ("<engineName>" + frontier.getprogramname () + "</engineName>");
add ("<engineLink>http://radio.userland.com/</engineLink>");
add ("<homePageLink>" + radio.weblog.getUrl (adrblog) + "</homePageLink>");
add ("<apis>"); indentlevel++;
add ("<api name=\"MetaWeblog\" preferred=\"true\" apiLink=\"http://127.0.0.1:5335/RPC2\" blogID=\"home\"/>");
add ("<api name=\"Blogger\" preferred=\"false\" apiLink=\"http://127.0.0.1:5335/RPC2\" blogID=\"home\"/>");
add ("</apis>"); indentlevel--;
add ("</service>"); indentlevel--;
add ("</rsd>"); indentlevel--;
file.writewholefile (f, xmltext)} //write out the XML file
<<bundle //test code
<<writeRsdFile (radio.file.getAbsolutePath (user.radio.prefs.rsdXmlFilePath))
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.