The return of the blogroll
I’ve bought the blogroll back since it disappeared during the upgrade. It’s now generated from my google reader opml feed which I export and run though some ruby which means it’s going to be up-to-date more frequently.
Here is the code that takes the opml and outputs the html fragment:
#!/usr/bin/ruby
require 'rexml/Document'
require 'pp.rb'
class FeedData
attr_accessor :name, :url, :category
def initialize( name, url, category )
( @name, @url, @category ) = name, url, category
end
end
class FeedDataList
def initialize()
@array = Array::new
end
def add( name, url, category )
tmpFeed = FeedData::new( name, url, category )
@array.push( tmpFeed )
end
def eachCategory
catArray = Array::new
@array.each do |feed|
if !catArray.member?( feed.category ) then
catArray.push( feed.category )
end
end
catArray.sort.each do |result|
yield result
end
end
def eachItemInCategory( category )
@array.each do |feed|
if feed.category == category then
yield feed
end
end
end
end
def parse_opml( opml_node, feeds, parents_names=[] )
opml_node.elements.each('outline') do |element|
if element.elements.size != 0 then
feeds = parse_opml( element, feeds, parents_names + [ element.attributes[ 'text' ] ] )
end
if element.attributes['xmlUrl'] then
feeds.add( element.attributes['title'], element.attributes['htmlUrl'], parents_names.last )
end
end
return feeds
end
opml = REXML::Document.new( STDIN )
feeds = FeedDataList::new
feeds = parse_opml( opml.elements['opml/body'], feeds )
feeds.eachCategory do |category|
print "<br /><strong>#{category}</strong> "
feeds.eachItemInCategory( category ) do |item|
print "<a href=\"#{item.url}\">#{item.name}</a> "
end
print "\n"
endTo make it work:
$ ./opml2html.rb < <opml file>I got the inspiration for the recursive opml parsing code from the Dekstop blog, so thanks are due to them!
Upgrade completed
Well, that upgrade seems to have been completed OK with a couple of issues: I had a couple of glitches one of which was to do with the rails backup of my database – fixed by turning off the backup stage in the rails installer. There was also an issue with my tags: I’ve known that my tags caused problems in the past with my use of the full stop. In the new typo it causes major problems so I wrote a quick script to replace full stops with underscores. Hopefully all is well now!
Rubbish terrorist threat of the week 3
Written in today’s Metro by David Hill of the World Innovation Foundation
‘Government business secretary John Hutton’s announcement that Britain could have one wind turbine every half-mile along the nation’s coastline by 2020 is a terrorist’s dream come true. For, if we are to become so reliant upon this isolated energy generation, there is no way to protect them.’
He does go on to make some slightly better points but this just caught my eyes as a really spurious use of the threat of terrorism to argue the case against something he doesn’t like.
To use it as the opening argument of his correspondence really does smack of desperation as well.
As for the WIF, a quick google shows that the only person who really talks up WIF is David Hill. The few others that discuss it either believe it is a hoax or a well meaning, but ultimately flawed organization.
Coz' the Facebook ain't listening... 2
So, Channel 4 has quizzed facebook about just why they make it so hard to delete an account. For those of you just catching up, facebook allow you to ‘deactivate’ an account very easily but not delete all the data that you have put into their system. In order to fully delete the account, you need to manually delete every single item that you have placed into their care. They have said in the past that this is to make it easy to reactivate your account should you suffer a change of heart.
They make the following point:
Facebook does not use any information from deactivated accounts for advertising purposes.
They have to say this. One of the major value proposition of facebook is that they give you a useful tool to do what you want with in return for making money off your personal data from advertising revenue. I feel that it would be very wrong for them to farm out your data if you are no longer getting some benefit from it.
So, why keep it, and why make it so hard to properly remove yourself from their servers? I really hope the reasons are technical and that the database design has been organically grown or designed such that there is no referential integrity, thus making it harder to traverse down the various content stores working out who owns what.
At the risk of calling down the ire of facebook (and yes, I would be temporarily lost without it) I am seriously beginning to consider whether I want to give my data to this company no matter how granular the access controls are when there are some interesting alternatives (and no, I’m not talking about the excerable myspace).
So, we shall see. This isn’t yet my ‘turn off facebook moment’ but it may well not be far around the corner…
[Edited to add – this is an interesting take as well which makes one wonder – they say they don’t use deactivated information for advertising purposes. However, that answer very effectively excludes the many, many other uses the data has. Worrying.]
SSH attackers now using botnets

I’m used to seeing ssh dictionary attacks from single IPs, hitting my servers in a short amount of time. For the first time today, however, I have had entries like the following:
Oct 22 15:05:54 [sshd] error: PAM: Authentication failure for root from <hostname>
...fairly regularly spaced throughout the day, all from different hosts. The natural assumption is that the dictionary attacks are now being run from botnets.
Anyone else seeing these? In the past when noticing dictionary attacks I’ve blocked the source IP; that now seems a little harsh for hosts that are being used without their owners’ consent. If a lot of people did that it may encourage the owners to take more notice of their security, but such a draconian measure would require a large amount of people to take part in order for it to be effective.
A DNSBL for firewalls would be a possible solution, although there would have to be a way of notifying people the reason they can’t connect to a particular host.
Schadenfreude
A few excerpts from an article in this morning’s City AM (shame about the flash site):
Patientline, the company which offers hospital-bedside premium rater phone and television services has announced plans to cut the cost of calls, after admitting that a recent 160 per cent increase was “a mistake”.
The company caused controversy when it raised call charges for patients from 10p to 26p a minute in April.
[...]
Since the April price rise, Patientline has had to hold emergency talks with its lenders about its £80m debt.
Couldn’t have happened to a nicer company…
Twitter to facebook status ruby script
UPDATE 2007-09-30: You can now make the twitter facebook application update your status, so this is now redundant!
UPDATE 2007-09-09 (Cribbed from Christian’s site as I couldn’t put it any better): It is with great disappointment that I must make this announcement. Facebook has requested that I remove the code from my website. They have also contacted everyone else who has found my code and publicly mentioned that they are using it.
I am saddened at this turn of events because the idea behind the code was to extend Facebook’s current service and fill in the gap that their API had. The API still does not provide a means for updating ones status.
I’ve been wanting to update my facebook status with my twitterings for some time now. Unfortunately facebook do not provide an API for setting the status so I have been thwarted. Until now. Yesterday I accidentally found Christian Flickinger’s blog entry where he has found a way to update facebook status using php. At the end of his blog he writes:
Anyone with some experience could easily use the above code to check Twitter and (if updated) push to Facebook. Happy mashing!
I know how the twitter api works and I’m a big fan of ruby so I thought I would pick up the gauntlet and hack up a quick ruby script to do just that.
You’ll need to install the json and curb gems for it to work. Then copy and paste the below code into a file called fbTwit.rb in a suitable place on your unix box (it writes state down so you may want it in it’s own directory), edit the variables so that they are correct for your accounts, run it by hand to check it works for you and then set it to run every (say) 10 minutes via cron with something like the following in your crontab:
00,10,20,30,40,50 * * * * cd [directory]; ./fbTwit.rb 2>&1 > /dev/null
# Code removed at the request of facebook.The quality of the code probably isn’t that great: it only took a short time to write, but it works (for me).
[2007-08-01] Yesterday this stopped working, along with the SSL login for m.facebook.com. I have changed it to use the http login which still works, although whether you want your password sent in the clear is up to you.
The restricted iPhone

Apart from the lack of 3g, the dire amount of storage and the lack of video, and the lock in to iTunes:
Apple is understood to be demanding that its European mobile phone partners hand over a significant proportion of revenues generated by the iPhone and restrict the content that users can access. [My emphasis added]
From: Vodafone put off by Apple’s demand for big iPhone slice.
Now, 3 tried this and look how successful they have been. Look, Apple / whoever the hell gets the bloody exclusive contract: give me access to what I damn well like or I’ll never ever buy your overpriced bit of hype.
Exclusive contracts are crap for the consumer anyway so I’m certainly not going to be moving from my current provider just to get it, even if I were sad enough to want it more than anything else in the whole world.
[hat-tip to Tim]
New Typo, hopefully less downtime this time!

There is a new version of Typo out which I have been holding off upgrading to after the last upgrade mess. There have been no problems reported on the mailing list though, so it’s time to upgrade.
Fingers crossed…
[08:40] Well, that was quick and easy. Much less fraught than last time!