Last active
December 27, 2016 21:35
-
-
Save picatz/a09629abc2cffa9c2b7518a119f97c34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomLogParser | |
# ... previous code for CustomLogParser | |
def single_timeline(ip) | |
info = Hash.new(0) | |
@data.each do |d| | |
next unless d[:ip] == ip | |
time = d[:time].strftime("%B %m, %Y") | |
info[time] += 1 | |
end | |
info | |
end | |
end | |
# ... previous code for app.rb | |
post '/timeline' do | |
@ip = params[:ip] # def not gunna be any XSS or anything lol | |
@single_timeline = parser.single_timeline(params[:ip]) | |
erb :timeline | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment