and twitter OLPC – One Line Per Contact

I’ve been having fun with and twitter recently, but some of my contacts, friends, followees, subscriptions (or whatever you want to call them) send many more messages than others. One contact gave a running commentary on his progress up the floors of a building yesterday. Fine, but a bit of a torrent of data.

If someone posts and leaves it for a while, it’s sometimes an explanation of where they’ve gone, so I’d like to check people’s last tweets. I’ve seen some clients do that and it seems there’s a method in the API to do it. The API returns XML, so I’m using XSL to transform it to xhtml (I’ve still not taken the time to learn the XML CSS ways) with the following commands:-

	wget --no-check-certificate -O - | \
	sed -e '1a\
<?xslt-param name="site" select=""?>\
<?xml-stylesheet title="Site Summaries" type="text/xsl" href="twitters.xsl" ?>
' > identica.xml

And here’s twitters.xsl which converts the downloaded xml to xhtml:-

<?xml version='1.0' ?>
<xsl:stylesheet version="1.0"
<xsl:param name="site"></xsl:param>

<xsl:template match="/" xml:space="preserve">
<html xmlns=""><head>
<title><xsl:value-of select="$site" /> Friends</title>
<link rel="stylesheet" type="text/css" href="mirrors.css" />
<dl class="statuses">
<xsl:apply-templates />

<xsl:template match="/users/user" xml:space="preserve"><dt><a href="http://{$site}/{screen_name}"><img src="{profile_image_url}" /><xsl:value-of select="name" /> (<xsl:value-of select="screen_name" />)</a> - <a class="time" href="http://{$site}/{screen_name}/statuses/{status/id}"><xsl:value-of select="status/created_at" /></a></dt><dd><xsl:value-of select="status/text" /></dd>

Have fun! (And what have I done wrong?)

This entry was posted in Wordpress and Blogs and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.