Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.macros.xmlCoffeeMug
on xmlCoffeeMug () { <<Changes <<7/1/02; 2:37:25 AM by JES <<Added alt attribute to the coffee mug image. <<6/23/02; 10:29:59 PM by JES <<Pass in false to radio.weblog.file.getCategoryFolder, for the value of flHtmlFolder. Respects the rssCategoryFolderPath preference. <<3/18/02; 6:31:55 PM by JES <<Added support for categories. <<1/24/02; 9:04:23 AM by DW <<Now works with the standard image as decided in this survey. <<http://www.userland.com/surveys/results/dave@userland.com/pickAnXmlCoffeeMug <<1/15/02; 8:10:54 PM by DW <<It's crude but it works. local (adrblog = radio.weblog.init ()); <<local (rssUrl = string.urlEncode (radio.weblog.getRssUrl (adrblog))) local (rssUrl, title); bundle { //get rssUrl & title local (pta = html.getPageTableAddress ()); if defined (pta^.categoryName) { local (folder = radio.weblog.file.getCategoryFolder (pta^.categoryName, adrblog, false)); rssUrl = radio.upstream.getFileUrl (folder + radio.data.filenames.weblogRssFileName); title = adrblog^.categories.[pta^.categoryName].displayName} else { rssUrl = radio.weblog.getRssUrl (adrblog); title = adrblog^.prefs.title}}; title = string.replaceAll (title, "\"", """); local (url = "http://127.0.0.1:5335/system/pages/subscriptions?url=" + rssurl); local (img = radio.macros.imageref ("/system/images/icons/xmlCoffeeCup.gif", alt:"Subscribe to "" + title + "" in Radio UserLand.")); return ("<a href=\"" + url + "\" title=\"Click on the XML coffee mug to subscribe to "" + title + "" in Radio UserLand.\">" + img + "</a>")}
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.