- <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)%>
- <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host)%>
+ <% w=nil
+ if Cache and w=Cache.get("WHOIS:#{voter.ipaddress}")
+ elsif Cache
+ w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)
+ w.search_whois
+ Cache.set("WHOIS:#{voter.ipaddress}", w)
+ else
+ w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)
+ w.search_whois
+ end
+
+ %>
+ <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host.reverse.slice(0,30).reverse)%>