Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.macros.headLinks
on headLinks () { <<Changes <<9/13/04; 12:49:42 PM by SK <<Added correct closing tag to all links to allow validation as XHTML <<12/14/02; 12:05:15 PM by DW <<The RSD link was in XML, but the others were not. Changed it so that it's not XML, to be consistent with what's already there. <<12/13/02; 9:34:43 AM by DW <<Add link to RSD file. <<6/2/02; 1:23:31 PM by DW <<Created. <<http://radio.userland.com/radioMacrosHeadLinks local (adrblog = radio.weblog.init ()); local (pta = html.getPageTableAddress ()); local (flcategory = defined (pta^.categoryName)); local (htmltext = "", indentlevel = 0); on add (s) { htmltext = htmltext + (string.filledstring ("\t", indentlevel) + s + "\r\n ");}; bundle { //add RSS link local (rssUrl); if flcategory { local (folder = radio.weblog.file.getCategoryFolder (pta^.categoryName, adrblog)); rssUrl = radio.upstream.getFileUrl (folder + radio.data.filenames.weblogRssFileName)} else { rssUrl = radio.weblog.getRssUrl (adrblog)}; add ("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"" + rssUrl + "\" />")}; bundle { //add mySubscriptions.opml link if user.radio.prefs.flSaveServicesXml { local (f = radio.file.getAbsolutePath (user.radio.prefs.servicesXmlFilePath)); add ("<link rel=\"subscriptions\" type=\"text/x-opml\" title=\"Subscriptions\" href=\"" + radio.upstream.getFileUrl (f) + "\" />")}}; bundle { //add rsd.xml link local (f = radio.file.getAbsolutePath (user.radio.prefs.rsdXmlFilePath)); add ("<link rel=\"EditURI\" type=\"application/rsd+xml\" title=\"RSD\" href=\"" + radio.upstream.getFileUrl (f) + "\" />")}; bundle { //add blogroll(s) if defined (pta^.blogRollUrls) { local (url); for url in pta^.blogRollUrls { add ("<link rel=\"blogroll\" type=\"text/x-opml\" title=\"Blogroll\" href=\"" + url + "\" />")}}}; return (htmltext)}
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.