Skip to content

Instantly share code, notes, and snippets.

@jamesramsay
Last active June 10, 2017 23:06
Show Gist options
  • Save jamesramsay/b76d6ece0658647df5cd to your computer and use it in GitHub Desktop.
Save jamesramsay/b76d6ece0658647df5cd to your computer and use it in GitHub Desktop.

Revisions

  1. James Ramsay revised this gist Jan 5, 2016. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,13 @@ Using `jq` (`brew install jq`):
    ```
    cat mobile.nytimes.com.20151006.har | \
    jq '.log.entries | map( [.startedDateTime, .time, .request.url, .response.content.mimeType, .response.content.size, (.response.content.size - (.response.content.compression // 0)) ] | @tsv ) | .[]' > mobile.nytimes.com.20151006.tsv
    ```
    ```

    V2:

    ```
    cat mobile.nytimes.com.har | \
    jq '.log.entries | map( [.startedDateTime, .time, .request.url, .response.content.mimeType, .response.content.size, (.response.content.size - (.response.content.compression // 0)), .response._transferSize, .response.status, .response.statusText ] ) | .[] | @csv' -r >> mobile.nytimes.com.csv
    ``
  2. James Ramsay revised this gist Oct 5, 2015. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,6 @@ Methodology:
    Using `jq` (`brew install jq`):

    ```
    at mobile.nytimes.com.har | \
    jq '.log.entries | map( {dateTime: .startedDateTime, time: .time, url: .request.url, mimeType: .response.content.mimeType, size: .response.content.size, transferred: (.response.content.size - (.response.content.compression // 0)) } ) ' | \
    head
    cat mobile.nytimes.com.20151006.har | \
    jq '.log.entries | map( [.startedDateTime, .time, .request.url, .response.content.mimeType, .response.content.size, (.response.content.size - (.response.content.compression // 0)) ] | @tsv ) | .[]' > mobile.nytimes.com.20151006.tsv
    ```
  3. James Ramsay revised this gist Oct 5, 2015. 1 changed file with 0 additions and 36855 deletions.
    36,855 changes: 0 additions & 36,855 deletions mobile.nytimes.com.20151005.har
    0 additions, 36,855 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
  4. James Ramsay revised this gist Oct 5, 2015. 1 changed file with 36855 additions and 0 deletions.
    36,855 changes: 36,855 additions & 0 deletions mobile.nytimes.com.20151005.har
    36,855 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
  5. James Ramsay created this gist Oct 5, 2015.
    18 changes: 18 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    # Analysis of editorial vs advertising content

    Methodology:

    - Access mobile site using Chrome device debugging tools
    - Record network activity
    - Save as HAR
    - Clean recording

    ## Clean Recording

    Using `jq` (`brew install jq`):

    ```
    at mobile.nytimes.com.har | \
    jq '.log.entries | map( {dateTime: .startedDateTime, time: .time, url: .request.url, mimeType: .response.content.mimeType, size: .response.content.size, transferred: (.response.content.size - (.response.content.compression // 0)) } ) ' | \
    head
    ```