How to create a blogroll

a picture of myself

Münsterland.org

To create a blogroll (a list of blogs you are reading) you need a story and a timer. An example for the blogroll is in Blogs I am reading. To create this blogroll, you first create the text. The text should be of type HTML to circumvent problems due to Structured Text. Of course, you could use other markup to create an OPML blogroll. We will show later on how to do that.

My blogroll story looks like this:

<table border="0" width="100%">
<tr><td colspan=2>First the blogs where I have direct access to RSS/RDF feed files.<br><br></ td></tr>
#set $liste = $aggregator.getFeeds()
#set $res = $liste.sort(lambda a,b: cmp(a['title'].lower(),b['title'].lower()))
#for $feed in $liste
#if $feed['url'].find('newsisfree') < 0
<tr>
<td class="whiteboxsmall">$macros.linkTag($feed['link'], $feed['title'])</td>
<td><a href="$feed['url']">$macros.imageTag('images/miniXmlButton.gif')</a></td>
</tr>
#end if
#end for
<tr><td colspan=2><br>Now the blogs I read through $macros.linkTag('http://www.newsisfree.com', 'NewsIsFree'). I can't give RSS/RDF feed files here, as they are restricted for registered users.<br><br></td></tr>
#for $feed in $liste
#if $feed['url'].find('newsisfree') >= 0
<tr>
<td class="whiteboxsmall">$macros.linkTag($feed['link'], $feed['title'])</td>
<td> </td>
</tr>
#end if
#end for
</table>

This text is hooked up in your TimerTool via timer preferences to run for example every 120 seconds.

Starting with version 0.4.18 of the Python Desktop Server, you can switch a story to not show up in your RSS feed. Since this story doesn't contain stuff written by you and since it is triggered by a timer and so would trigger weblogs.com and community pinging due to it's changes, it is a good idea to leave this story out of the RSS feed.

Another blogroll option (I mentioned it above) is the OPML-blogroll. This is done in mostly the same way, with a story, a timer and this time a macro "store an OPML version of your blogroll". You can copy the macro source directly. This all isn't needed with PyDS 0.7 any more, since PyDS from version 0.7 on includes native OPML generation!.

If you run PyDS 0.7 or newer, you just go to your preferences page for the aggregator preferences and change the feed sharing to share feeds. You can set single changes to sharing or not sharing, or to use the default setting from your preferences. So if you just want to share selected feeds, keep the preferences setting to don't share and set single feeds to allways share. If you don't want to feed some feeds, set those to never share. Your OPML file is saved as /aggregator/subscriptions.opml. If you run an older release of PyDS, you don't have OPML sharing, so read on.

Creating the OPML blogroll story First you define the story. This story should be set to draft, as you don't want to upstream it. The reason is, this story doesn't create HTML but OPML. But when upstreaming stories, the story content is included into the BaseRendering.tmpl and that is HTML. The result looks funny. So just set it to be draft, so it is rendered locally, but not upstreamed. And you connect the macro we wrote above to this text. To the left is a screenshot (click on the thumbnail to see a bigger version) of how to create this text. The content is as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
<opml version="1.1">
<head>
<title>mySubscriptions</title>
<ownerName>$prefs.get('private','name')</ownerName>
<ownerEmail>$prefs.get('private','email')</ownerEmail>
<expansionState></expansionState>
<vertScrollState>1</vertScrollState>
<windowTop>362</windowTop>
<windowLeft>422</windowLeft>
<windowBottom>562</windowBottom>
<windowRight>798</windowRight>
</head>
<body>

#set $liste = $aggregator.getFeeds()
#set $res = $liste.sort(lambda a,b: cmp(a['title'].lower(),b['title'].lower()))
#for $feed in $liste
#if $feed['url'].find('newsisfree') < 0
<outline text="$macros.quoteXML($feed['title'])" description="$macros.quoteXML($macros.stripHTML($feed['description']).replace('\n',' '))" htmlUrl="$feed['link'].replace('\n','')" title="$macros.quoteXML($feed['title'])" xmlUrl="$feed['url']"/>
#end if
#end for

</body>
</opml>

Now hook up the story in your timers, as you did with the normal blogroll. A last step is to change your custom headers nugget: This nugget will deliver custom headers. You should use the Nugget *customHeaders* instead (I don't use it anymore, since 0.7 includes native OPML support). This nugget is called in all pages in the headers and allows you to enter several headers that should be given in every page. This is so that other tools can automatically discover your OPML blogroll.

That's it. Now you have a working OPML blogroll and a normal blogroll. You can link your normal blogroll from the nugget firstBelowCalendar or put it into your navigation preferences. After all your changes you should rerender your complete site, so that all pages link the same pages and have the same headers.

last change 2004-01-05 16:10:56

January 2004
MoTuWeThFrSaSu
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 
Dec
2003
 Feb
2004

This text documents how to create a blogroll for your weblog.


(Donations will be used by the author to buy stuff, fullfill selfish wishes or do other silly recreational things. You have been warned.).
The PyDS is
OSI Certified Open Source Software

Python Powered

XML-Image

© 2004-2007, Georg Bauer