Skip to content

Instantly share code, notes, and snippets.

@mikedao
Last active August 29, 2015 14:12
Show Gist options
  • Save mikedao/784c44d9e9aac1069a9e to your computer and use it in GitHub Desktop.
Save mikedao/784c44d9e9aac1069a9e to your computer and use it in GitHub Desktop.
Get all requests that match :identifier
get matching user_agent_ids
get matching user_agent
os = user_agent.split(' ')[1]
count requests that match os
create hash {os => count }
display os[1..-2] + count
1. Get all requests that match :identifier.
2. Get all url_ids.uniq
3. For each url_id count requests
4. Create hash {url_id => number of requests}
5. Sort hash by value
6. Display url that matches url_id and number of requests
1. Get all requests that match :identifier
2. get matching user_agent_ids
3. get matching user_agent
4. browswer = user_agent.split(' ')[0]
5. set up hash {browser => #of occurrences}
6. Sort hash by values
7. display browser + occurrences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment