Skip to content

Instantly share code, notes, and snippets.

@itochu0523
itochu0523 / file0.sql
Last active November 5, 2015 07:53
##トレジャーデータのJSSDKで収集したログでユーザーセグメントを作成する方法 ref: http://qiita.com/itochu0523/items/4113e35c587ab40c384f
-- Presto
SELECT
a.td_client_id as td_client_id
,a.td_os as td_os
,'Weekly_Over5_Accesses' as segment_name
FROM
(
SELECT
td_client_id
@itochu0523
itochu0523 / td-job.rb
Last active September 24, 2015 10:02
td-job.rb
require 'td'
require 'td-client'
require 'time'
require 'date'
# auth
auth_key = File.read("client.cfg", :encoding => Encoding::UTF_8)
cln = TreasureData::Client.new(auth_key)
# argv
date = ARGV[0]
use strict;
use warnings;
my @offset = (20, 20, -20, -20);
while(<*.pdf>)
{
next if /-cropped/;