This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'garb' | |
| require 'uri' | |
| require 'active_support/time' | |
| require 'yaml' | |
| # 認証クラス | |
| class AnalyticsService | |
| def load_profile(user_data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Host heroku.com | |
| User git | |
| port 22 | |
| Hostname heroku.com | |
| IdentityFile ~/.ssh/heroku_rsa | |
| TCPKeepAlive yes | |
| IdentitiesOnly yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE> | |
| <html> | |
| <head> | |
| <title>Hello Google Analytics API</title> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <!-- 認証処理系ボタン --> | |
| <button id="authorize-button" style="visibility: hidden">googleアカウント認証</button><br/> | |
| <button id="logout-button" style="visibility: hidden" onclick="location.href='https://accounts.google.com/logout'">googleアカウント認証解除</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE> | |
| <html> | |
| <head> | |
| <title>Hello Google Analytics API</title> | |
| </head> | |
| <body> | |
| <!-- ユーザの実行ボタン --> | |
| <button id="authorize-button" style="visibility: hidden">Authorize</button><br/> | |
| <button id="make-api-call-button" style="visibility: hidden">Get Sessions</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Time::Piece; | |
| use Time::Seconds; | |
| # Time::Pieceオブジェクトの取得 | |
| print "Time::Piece ",$Time::Piece::VERSION,"\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Time::Piece; | |
| use Time::Seconds; | |
| # Time::Pieceオブジェクトの取得 | |
| my $t; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| : | |
| (中略) | |
| : | |
| $self->stash->{client_id} = $client_id; | |
| $self->render('example/index'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| my $res = { | |
| 'rows_date' => [ | |
| ['20121205', '1'], | |
| ['20121206', '2'], | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env casperjs | |
| # グーグルアナリティクスへログインし、日別PV数のTSVエクスポートデータを取得する | |
| casper = require('casper').create | |
| verbose: true | |
| loglevel: 'debug' | |
| pageSettings: | |
| "webSecurityEnabled": false | |
| "ignoreSslErrors": true | |
| "userAgent": 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // コマンドラインからparameter を受け取り、facebookにログインしてログイン後のホーム画面をキャプチャする | |
| // 引数受け取り | |
| var system = require("system"); | |
| var username = system.args[1]; | |
| var password = system.args[2]; | |
| // facebookログイン | |
| var page = require("webpage").create(); | |
| page.open("https://ja-jp.facebook.com/",function(){ |
NewerOlder