Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (16 sloc) 0.556 kb
require 'rubygems'
require 'lib/log.rb'
require 'lib/wurfl.rb'
wurfl = Wurfl.new()
STDIN.read.split("\n").each do |entry|
log = Log.new().parse entry
if phone = wurfl.lookup( log.ua )
puts [log.ip, log.status, log.method, log.ua, log.resource,
phone[:device_os_version], phone[:device_os],
phone[:brand_name], phone[:model_name],
phone[:mobile_browser], phone[:mobile_browser_version]
].join("\t")
else
puts ['unknown', nil, nil, log.ua].join("\t")
end
end
Jump to Line
Something went wrong with that request. Please try again.