{"id":118,"date":"2012-12-10T03:29:59","date_gmt":"2012-12-10T08:29:59","guid":{"rendered":"http:\/\/minireference.com\/blog\/?p=118"},"modified":"2012-12-10T03:29:59","modified_gmt":"2012-12-10T08:29:59","slug":"showing-off-with-python","status":"publish","type":"post","link":"https:\/\/minireference.com\/blog\/showing-off-with-python\/","title":{"rendered":"Showing off with python"},"content":{"rendered":"<p>2:57AM on a Monday.\u00a0I have to be up at 8AM. The faster I get the job done the more sleep I get. Sounds like the kind of thing to motivate a person.<\/p>\n<p>TASK: Parse an access.log file and produce page visit trace for each visitor. Ex:<\/p>\n<pre style=\"padding-left: 30px;\">11.22.33.90 on Monday at 3pm \u00a0 (Montreal, Firefox 4, on Mac OS X):\n\u00a0 \/contents \u00a0 \u00a0      (stayed for 3 secs)\n\u00a0 \/derivatives \u00a0 \u00a0   (stayed for 2m20sec)\n\u00a0 \/contents \u00a0 \u00a0      (6 secs)\n\u00a0 \/derivative_rules \u00a0(1min)\n\u00a0 \/derivative_formulas \u00a0(2min)\n\u00a0 end<\/pre>\n<p>I had already found some <a href=\"http:\/\/css.dzone.com\/articles\/apache-log-parsing-python\">access.log parsing code<\/a>, \u00a0and setup a processing pipeline from last time I wanted to work on this. Here is <a href=\"https:\/\/gist.github.com\/4249353\">what we have so far<\/a>.<\/p>\n<p>3:45AM.\u00a0Here is the plan. All the log entries are in a list called entries, which I will now sort and split by IP.<\/p>\n<p>4:15AM. <a href=\"https:\/\/gist.github.com\/4249678\">Done.<\/a>\u00a0Though I have to cleanup the output some more.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2:57AM on a Monday.\u00a0I have to be up at 8AM. The faster I get the job done the more sleep I get. Sounds like the kind of thing to motivate a person. TASK: Parse an access.log file and produce page visit trace for each visitor. Ex: 11.22.33.90 on Monday at 3pm \u00a0 (Montreal, Firefox 4, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,10,15],"tags":[],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-computers","category-metrics","category-tools"],"_links":{"self":[{"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":0,"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"wp:attachment":[{"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/minireference.com\/blog\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}