<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- OPML generated by Radio UserLand v8.2b9 on Thu, 30 Jun 2005 01:57:24 GMT -->

<opml version="1.1">
	<head>
		<title>rssTruncate.opml</title>
		<dateCreated>Sat, 18 May 2002 13:19:22 GMT</dateCreated>
		<dateModified>Thu, 30 Jun 2005 01:57:24 GMT</dateModified>
		<ownerName>Marc Barrot</ownerName>
		<ownerEmail>info@prec-it.com</ownerEmail>
		<expansionState>6</expansionState>
		<vertScrollState>1</vertScrollState>
		<windowTop>361</windowTop>
		<windowLeft>527</windowLeft>
		<windowBottom>656</windowBottom>
		<windowRight>1184</windowRight>
		</head>
	<body>
		<outline text="#title &quot;rssTruncate&quot;"/>
		<outline text="What is rssTruncate ?">
			<outline text="rssTruncate is a &lt;a href=&quot;http://frontier.userland.com/stories/storyReader$1047&quot;&gt;UserTalk&lt;/a&gt; macro command that shortens the xml/rss published version of each post to its title and first paragraph or sentence."/>
			<outline text="If the post is longer, a [read more] link to the HTML rendered version of the full post is appended."/>
			<outline text="In addition, any image inserted within the first paragraph/sentence is replaced by the [img] marker."/>
			</outline>
		<outline text="Why add truncation to the rss feed ?">
			<outline text="To make posts more readable in a news aggregator."/>
			<outline text="The first sentence or paragraph of each post should provide a clear indication of what the post is about, in addition to the post&amp;apos;s title."/>
			<outline text="Subscribers interested in the post can access the full version by clicking on the [read more] link."/>
			<outline text="With Radio, the post&amp;apos;s title usually provides the same link, but you can post without a title (a bad habit :-), or provide a different link for the title (something I do often in &lt;b&gt;s l a m&lt;/b&gt;)."/>
			</outline>
		<outline text="Installing rssTruncate.">
			<outline text="1. Display the rssTruncate code in a new browser window by clicking on &lt;a href=&quot;http://radio.weblogs.com/0104487/gems/code/rssTruncate.txt&quot; target=&quot;_blank&quot;&gt;this link&lt;/a&gt;."/>
			<outline text="2. Select all the code&amp;apos;s text and copy it."/>
			<outline text="3. In Radio, open the weblogData.callbacks.rssFilterDescription table."/>
			<outline text="4. Double-click on the empty &amp;apos;item #1&amp;apos; item, enter rssTruncate as name, and Script as type, then click zoom."/>
			<outline text="5. In the script editor window that pops up, paste the text of the rssTruncate script."/>
			<outline text="6. Delete all empty lines before: on rssTruncate (description, adrpost )"/>
			<outline text="7. Click the compile button, then close the script editor window. That&amp;apos;s it, rssTruncate is ready for your next post."/>
			<outline text="8. If you want to see rss truncation in action :">
				<outline text="First subscribe to your own weblog."/>
				<outline text="Then post a new message."/>
				<outline text="Then quit and restart Radio, and check the last published message in Radio&amp;apos;s News Aggregator."/>
				</outline>
			</outline>
		<outline text="How does it work ?">
			<outline text="rssTruncate tries to retrieve the first HTML paragraph of the post, using html.getOneTagValue ( description, &quot;P&quot; ) )">
				<outline text="The first HTML paragraph is any string encapsulated by the &lt;p&gt; and &amp;lt;/p&amp;gt; tags. The tag is not case sensitive.&lt;/p&gt;"/>
				</outline>
			<outline text="If there is no formal HTML paragraph to retrieve, rssTruncate gets the first sentence of the post, using string.firstSentence ( description ).">
				<outline text="The first sentence is any string preceding a dot followed by a &amp;apos;whitespace&amp;apos; character."/>
				<outline text="In that case, any leading &lt;p&gt; tag, part of a malformed HTML 4.0 paragraph is stripped from the sentence.&lt;/p&gt;"/>
				</outline>
			<outline text="The length of the first paragraph/sentence is then compared with the length of the full post description, stripped of any leading/trailing paragraph tags."/>
			<outline text="If the full description is longer than the first paragraph/sentence, the [read more] link is appended.">
				<outline text="The link is computed by starting with the weblog home url returned by radio.macros.homePageUrl()."/>
				<outline text="Then a path to the post&amp;apos;s page is computed out of the post&amp;apos;s date, accessed through rssTruncate&amp;apos;s second parameter: the address of the post&amp;apos;s table in weblogData."/>
				<outline text="Finally, an anchor within the page is added, based on the post&amp;apos;s item number."/>
				</outline>
			<outline text="The last step is to remove any image included in the first paragraph/sentence.">
				<outline text="The img html tag is any string starting with &lt;img ,=&quot;&quot; followed=&quot;&quot; by=&quot;&quot; any=&quot;&quot; number=&quot;&quot; of=&quot;&quot; characters=&quot;&quot; different=&quot;&quot; from=&quot;&quot;&gt;, followed by &amp;gt;."/>
				<outline text="The whole &lt;img&gt; tag is replaced by an [img] marker."/>
				</outline>
			<outline text="The completed abbreviated description is then returned to the rss publishing routine."/>
			</outline>
		<outline text="Credits">
			<outline text="rssTruncate originates from a hack by Jon Udell, who can be considered the &lt;a href=&quot;http://radio.weblogs.com/0100887/2002/04/11.html#a186&quot;&gt;pioneer of rss truncation&lt;/a&gt;."/>
			<outline text="Dave Winer then added a &lt;a href=&quot;http://radio.userland.com/descriptionFilterCallbacks&quot;&gt;callbacks table&lt;/a&gt; to rss publication, making this hack both cleaner and supported by UserLand."/>
			<outline text="Paul Holbrook came up with the idea of using the &lt;a href=&quot;http://radio.weblogs.com/0106188/2002/04/11.html#a40&quot;&gt;first HTML paragraph&lt;/a&gt; of each post instead of the first sentence."/>
			</outline>
		</body>
	</opml>
