Instant Outline Manager Macro

Dann Sheridan radio-outline@userland.com
Sat, 30 Mar 2002 18:03:06 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_03D8_01C1D815.24AF0FD0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Rogers:

This is very cool.  I have been trying to figure out a way to take Joshua
Allen's OPML and XSLT work and make it work in this manner.  This is a
perfect way to do it.  I modified the ioLinks macro to output a "View It"
option.  Have a look at my weblog for an example:

http://radio.weblogs.com/0001134/

I have tested this a few times now.  The first node is not selectable or
expandable.  This could be because the XSLT declaration is coming before the
XML declaration.  I'm not sure, just a guess.

Thanks for making this available.

-Dann

----- Original Message -----
From: "Rogers Cadenhead" <rogers@cadenhead.org>
To: <radio-outline@userland.com>
Sent: Saturday, March 30, 2002 4:51 PM
Subject: Re: Instant Outline Manager Macro


On Sat, 30 Mar 2002 13:44:24 -0500, Dann Sheridan wrote:
>Once in your templates, it will produce a list  of I/O's on your
>page with a link and an orange OPML button linked to the
>outlinerSubscribe page in Radio.  You can see an example of this
>macro at  work on my weblog under the calendar:
>
>http://radio.weblogs.com/0001134/

This is very cool.

I wanted to take a look at some of these Instant Outlines without
leaving my web browser, so I wrote a Java servlet that opens them as
XML files using an XSLT transformation. The details are here:

http://rcs.myelin.cjb.net/users/0000001/2002/03/30.html#a58
--
Rogers Cadenhead, rogers@cadenhead.org on 3/30/2002
http://www.cadenhead.org




------=_NextPart_000_03D8_01C1D815.24AF0FD0
Content-Type: text/plain;
	name="ioLinks.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="ioLinks.txt"

on ioLinks (url) {
	local (xmltext =3D tcp.httpReadUrl (url), xstruct);
	xml.compile (xmltext, @xstruct);
	local (adropml =3D xml.getAddress (@xstruct, "opml"));
	local (adrbody =3D xml.getAddress (adropml, "body"));
	local (htmltext =3D "", indentlevel =3D 0);
	on add (s) {
		htmltext =3D htmltext + string.filledstring ("\t", indentlevel) + s + =
"\r"};
	local (adr);
	for adr in adrbody {
		if nameof (adr^) contains "outline" {
			local (ioUrl=3Dadr^.["/atts"].url);
			local (ioDescription=3Dadr^.["/atts"].text);
			local (subUrl =3D =
"http://127.0.0.1:5335/system/pages/outlinerSubscribe?url=3D" + =
string.urlencode(ioUrl) + "&author=3D" + string.urlencode(ioDescription) =
+ "&weblog=3D" + string.urlencode (radio.weblog.getUrl ()));
			add ("<a href=3D\"" + subUrl + "\">" + ioDescription + "</a><br>");
			add("<a href=3D\"" + subUrl + "\"><img =
src=3D\"http://radio.weblogs.com/0001134/images/opml.gif\" =
width=3D\"36\" height=3D\"14\" border=3D\"0\" alt=3D\"Click on image to =
add this Instant Outline to your Radio UserLand buddy list.\"></a>");
			add("<a =
href=3D\"http://www.cadenhead.org/servlet/ViewInstantOutline?opmlFile=3D"=
 + ioURL + "\"><img =
src=3D\"http://radio.weblogs.com/0001134/images/view_it.jpg\" =
width=3D\"36\" height=3D\"14\" border=3D\"0\" alt=3D\"Click on the image =
to view this Oultine in your browser.\"></a>");
			add("<br><br>")}};
	return (htmltext)}
------=_NextPart_000_03D8_01C1D815.24AF0FD0--