projects
/
selectricity-live
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use WHOIS to search up meaningful organizational data about voters. NOTE: Probably...
[selectricity-live]
/
app
/
views
/
quickvote
/
results.rhtml
diff --git
a/app/views/quickvote/results.rhtml
b/app/views/quickvote/results.rhtml
index 3b3a54d9ef68e11128b22891956d9bdb05cdf9fd..1df2856e4416b8d2ff81e905d673be82bf8420f1 100644
(file)
--- a/
app/views/quickvote/results.rhtml
+++ b/
app/views/quickvote/results.rhtml
@@
-1,4
+1,4
@@
-<%require '
IPAddr
' %>
+<%require '
whois/whois
' %>
<h1>Results</h1>
<% if @election.shortdesc %>
<h1>Results</h1>
<% if @election.shortdesc %>
@@
-156,7
+156,8
@@
by several other names.</p>
<tr>
<td><%= voter.ipaddress %></td>
<td><% begin %>
<tr>
<td><%= voter.ipaddress %></td>
<td><% begin %>
- <%= `host #{IPAddr.new(voter.ipaddress).to_s}`.sub(/^.*pointer (.*)\.$/, '\1') %>
+ <% raise ArgumentError.new if voter.ipaddress == "127.0.0.1" %>
+ <%= Whois::Whois.new(IPAddr.new(voter.ipaddress).to_s).search_whois.grep(/^OrgName/)[0].sub(/^OrgName\:/,'').strip %>
<% rescue ArgumentError => err %>
<%= voter.ipaddress %>
<% rescue ArgumentError => err %>
<%= voter.ipaddress %>
Benjamin Mako Hill
||
Want to submit a patch?