2009-05-01

tobyaw: (Default)
2009-05-01 12:57 pm

Lunch at home

Working from home today. Due to late return from Dundee yesterday, we got a carryout for tea. Plentiful leftover Chinese food for lunch — yum!

Now Kate has brought through a big bowl of melon. Must go and get some before Beth scoffs it all.
tobyaw: (Default)
2009-05-01 12:57 pm

Lunch at home

Working from home today. Due to late return from Dundee yesterday, we got a carryout for tea. Plentiful leftover Chinese food for lunch — yum!

Now Kate has brought through a big bowl of melon. Must go and get some before Beth scoffs it all.
tobyaw: (Default)
2009-05-01 03:03 pm

Which of your LJ friends are on DW?

Don’t know whether there is an easier way to do this. This script will read a user’s LJ friends list, and check to see whether DW accounts with the same names exist.

#!/usr/bin/ruby

require 'open-uri'

friends = Array.new

ARGV.each do |lj_user|
  open("http://www.livejournal.com/misc/fdata.bml?user=#{lj_user}").readlines.each do |line|
    friends.push line.slice(2...line.length).strip if line =~ /^<|>/
  end
end

friends.sort.uniq.each do |friend|
  puts friend if open("http://users.dreamwidth.org/#{friend}").read !~ /^<h1>Unknown User/
end
tobyaw: (Default)
2009-05-01 03:03 pm

Which of your LJ friends are on DW?

Don’t know whether there is an easier way to do this. This script will read a user’s LJ friends list, and check to see whether DW accounts with the same names exist.

#!/usr/bin/ruby

require 'open-uri'

friends = Array.new

ARGV.each do |lj_user|
  open("http://www.livejournal.com/misc/fdata.bml?user=#{lj_user}").readlines.each do |line|
    friends.push line.slice(2...line.length).strip if line =~ /^<|>/
  end
end

friends.sort.uniq.each do |friend|
  puts friend if open("http://users.dreamwidth.org/#{friend}").read !~ /^<h1>Unknown User/
end