#!/usr/bin/env ruby print "Content-type: text/plain;\n\n" require 'steam-condenser' require 'cgi' cgi = CGI.new for friend in SteamId.new(cgi.params['u'][0]).friends do Thread.new(friend) do | threadfriend | begin if threadfriend.games.to_s =~ /#{cgi.params['g'][0]}/ threadfriend.fetch printf("%s %-25s %s\n", threadfriend, threadfriend.instance_variable_get(:@nickname), threadfriend.instance_variable_get(:@state_message).gsub(/<.+?>/,' ')) STDOUT.flush end rescue Exception => e print threadfriend, " FAILED: ", e, "\n" next # sometimes a profile doesn't exist end end sleep(0.05) end