All pastes #960589 Raw Edit

Stuff

public ruby v1 · immutable
#960589 ·published 2008-03-28 08:19 UTC
rendered paste body
if line =~ /.*?PRIVMSG #{channel} :!lfm_last (.*)/                        user = $1                        page = %x[wget -O - http://www.last.fm/user/'#{user}']                        flag = 0                        page.each_line do |line|                                if flag == 0                                        if line =~ /<a.*>(.*)<\/a> .* <a.*>(.*)<\/a>/                                                sock.puts "PRIVMSG #{channel} :Latest track for #{user}: #{$1} - #{$2}\r\n"                                                flag = 1                                        end                                end                        end                        sock.puts "PRIVMSG #{channel} :Unable to find last.fm information for #{user}.\r\n" if flag == 0                end