Monday, November 08, 2010 at 12:05 AM.

system.verbs.builtins.radio.outliner.macros.coffeeMug

on coffeeMug () {
	<<Changes
		<<11/12/02; 1:26:17 PM by JES
			<<Use & instead of & as getArg delimiters. Fixes a problem with HTML 4 validation.
		<<8/29/02; 11:26:19 PM by JES
			<<Include the server name as part of the Jabber ID when generation a Jabber-ish OPML coffee mug.
		<<8/28/02; 8:27:35 PM by JES
			<<Fixed a copy/paste bug in the code that generates teh Jabber version of the link.
		<<8/27/02; 1:00:59 AM by JES
			<<Added arguments to the URL for the mug, which let the clicker know what IM protocol (if any) they can use to request notification when the outline changes.
		<<3/25/02; 11:19:21 PM by JES
			<<Call through radio.outliner.getMyOutlineFile to get the path to my outline.
		<<3/24/02; 9:14:50 PM by JES
			<<Changed the local page from opmlSubscribe to outlinerSubscribe.
		<<3/13/02; 6:17:36 PM by DW
			<<Created.
	local (adrdata = radio.outliner.init ());
	local (f = radio.outliner.getMyOutlineFile ());
	
	local (adrfile);
	radio.file.getfileattributes (f, @adrfile);
	
	local (url = "http://127.0.0.1:5335/system/pages/outlinerSubscribe?url=" + string.urlencode (adrfile^.upstream.url) + "&author=" + string.urlencode (user.prefs.name) + "&weblog=" + string.urlencode (radio.weblog.getUrl ()));
	
	bundle { //add IM notification params to the URL
		if adrdata^.prefs.messaging.flEnabled {
			if adrdata^.prefs.messaging.flAimEnabled {
				url = url + "&imProtocol=aim&imUsername=" + user.im.aim.username + "&imRegisterProcedure=radioOutliner.requestNotification"}
			else {
				if adrdata^.prefs.messaging.flJabberEnabled {
					url = url + "&imProtocol=jabber&imUsername=" + user.im.jabber.username + "@" + user.im.jabber.host + "&imRegisterProcedure=radioOutliner.requestNotification"}}}};
	
	return ("<a href=\"" + url + "\"><img src=\"http://radio.weblogs.com/0001015/images/2002/03/16/opmlMugTransparentGray.gif\" width=\"97\" height=\"120\" border=\"0\" alt=\"Click on the coffee mug to add " + user.prefs.name + "'s Instant Outline to your Radio UserLand buddy list.\"></a>")};
bundle { //test code
	webbrowser.displaytext (coffeeMug ())}



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.