Skip to content

Instantly share code, notes, and snippets.

@skitazaki
skitazaki / combined2tsv.py
Last active January 9, 2021 10:36
Convert Combined Log Format into TSV file.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Convert Combined Log Format stream into TSV file.
To get known about access log, see Apache HTTP server official document.
* [`en <http://httpd.apache.org/docs/2.4/en/logs.html>`_]
* [`ja <http://httpd.apache.org/docs/2.4/ja/logs.html>`_]
@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}