Permalink
Browse files

execute pisg as a non-child process to avoid zombies, and fix links (…

…really)
  • Loading branch information...
Jamie Wilkinson
Jamie Wilkinson committed Jul 8, 2010
1 parent 0b395ed commit 3f11ef422dba23f179315431bd1f9d0bedeeab76
Showing with 3 additions and 3 deletions.
  1. +3 −3 fatbot.rb
View
@@ -148,9 +148,9 @@ def ops?(nick)
# echo back collected URLs
on :channel, /^\!(links|lionks)/i do
if $link_store[channel]
- msg channel, "Most Recent URLs (#{$link_store[channel].size} total)"
+ msg channel, "Most recent links (#{$link_store[channel].size} total)"
urls = $link_store[channel].map { |l| "http://#{l[:url]} posted by #{l[:nick]}" } || []
- urls.uniq[-3..-1].each { |url| msg channel, url }
+ urls.uniq.reverse[0..2].each { |url| msg channel, url }
else
msg channel, "No URLs yet!"
end
@@ -159,7 +159,7 @@ def ops?(nick)
# generate IRC stats using pisg
on :channel, /^\!stats/i do
begin
- IO.popen(File.dirname(__FILE__)+"/../pisg/pisg")
+ system("#{File.dirname(__FILE__)}/../pisg/pisg &")
msg channel, "stats regenerated for channel, http://173.45.226.44/irc/#{channel.to_s.gsub('#','').downcase}.html"
rescue
msg channel, "Error generating stats: #{$!}"

0 comments on commit 3f11ef4

Please sign in to comment.