[ create a new paste ] login | about

Link: http://codepad.org/CNaVyJ1H    [ raw code | fork ]

Ruby, pasted on Jul 8:
  def top_ips
       count = Hash.new(0)
       for entry in @data_table
         count[entry.split(' ')[3]] += 1
       end
       sorted = count.sort_by {|data, no| no }.reverse
       $top_list = []
       topno = 0
       sorted.any? do |line| 
	       if line[1].to_i > 1
		       if topno <= line[1].to_i
			       topno = line[1].to_i
			       $top_list << line
		       end
	       end
	       puts $top_list.size
	       p $top_list if $top_list.empty? == FALSE
       end
       # CONTINUE HERE!!!
       #-----------------
       
   end


Create a new paste based on this one


Comments: