Skip to content

Instantly share code, notes, and snippets.

View absyah's full-sized avatar

Ardian Bahtiarsyah absyah

  • Semarang, Indonesia
View GitHub Profile
@absyah
absyah / Gemfile
Created November 3, 2015 12:38 — forked from cblunt/Gemfile
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
@absyah
absyah / awsstatus.coffee
Created November 17, 2015 13:33 — forked from jeremykarn/awsstatus.coffee
A Hubot script for monitoring the aws status rss feed and posting messages to a campfire room whenever there's a new update.
#
# Copyright 2012 Mortar Data Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
// # Commands:
// # hubot rss-poll start <rss url> - Start polling for new content from the given rss feed.
// # hubot rss-poll stop <rss url> - Stop polling for content from the given rss feed.
// # hubot rss-poll list [all] - Lists the stored rss feeds for the given room or user.
crypto = require('crypto')
feedRead = require('feed-read')
module.exports = (robot) ->
feedData =
....................................................................*......*.*.........*.*.*......*.....*...............................................................................................................FF..................................................................................................................*..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................===== Creating instances =====
===== Finished to create instances =====
.===== Creating instances =====
===== Finished to create instances =====
.===== Creating instances =====
====
.attachinary_container{
margin-top: 20px;
}
.attachinary_container ul{
padding-left:0px;
}
.attachinary_container ul li{
# Investigation results for campaigns with no impressions
# API endpoint /stats/accounts/{account_id}/line_items/{line_item_id}
# parameters
{:start_time=>"2016-03-16T00:00:00+09:00",
:granularity=>"TOTAL",
:metrics=>
"conversion_purchases,billed_charge_local_micro,conversion_sign_ups,promoted_tweet_app_open_attempts,promoted_account_impressions,promoted_account_profile_visits,promoted_account_follows,promoted_account_follow_rate,conversion_site_visits,billed_follows,conversion_custom,mobile_conversion_sign_ups,promoted_tweet_app_install_attempts,conversion_sale_amount,mobile_conversion_purchases,billed_engagements,conversion_order_quantity,conversion_downloads,promoted_video_cta_clicks,promoted_video_replays,promoted_video_total_views,promoted_video_views_25,promoted_video_views_50,promoted_video_views_75,promoted_video_views_100,mobile_conversion_installs,promoted_tweet_timeline_engagements,promoted_tweet_timeline_impressions,promoted_tweet_timeline_url_clicks,promoted_tweet_timeline_clicks,promoted_
// https://dev.twitter.com/ads/analytics/metrics-derived
// the impressions calculation (website_click) :
// promoted_tweet_timeline_impressions"=>[1913],
// promoted_tweet_search_impressions"=>[0],
// promoted_tweet_profile_impressions"=>[419],
// impressions = 2332
[{"total_audience_reach"=>nil, "average_frequency"=>nil, "impressions"=>0, "engagements"=>0, "cpm"=>NaN, "link_clicks"=>0, "cp_link_click"=>NaN, "ctr"=>NaN, "cpe"=>NaN, "app_clicks"=>0, "app_ctr"=>NaN, "cp_app_click"=>NaN, "installs"=>0, "cp_install"=>NaN, "video_starts"=>nil, "video_plays_25"=>0, "video_plays_50"=>0, "video_plays_75"=>0, "video_plays_100"=>0, "video_plays"=>0, "video_replays"=>0, "video_play_rate"=>NaN, "cp_video_play"=>NaN, "video_ctp"=>0, "followers"=>0, "follow_rate"=>0.0, "cp_follows"=>NaN, "media_views"=>0, "media_view_rate"=>NaN, "leads"=>0, "lead_rate"=>NaN, "cp_lead"=>NaN, "qualified_impressions"=>0, "qcpm"=>NaN, "spend"=>0.0, "billed_engagements"=>0, "engagement_rate"=>NaN, "clicks"=>0, "retweets"=>0, "replies"=>0, "fo
# Logfile created on 2016-04-27 15:47:36 +0700 by logger.rb/47272
I, [2016-04-27T15:47:36.948311 #17739] INFO -- : [{"id"=>"kp53f", "id_data"=>[{"segment"=>nil, "metrics"=>{"impressions"=>[1395841], "billed_charge_local_micro"=>[419793000000], "follows"=>[11], "retweets"=>[116], "likes"=>[358], "engagements"=>[8044], "replies"=>[2], "billed_engagements"=>[108389]}}]}]
I, [2016-04-27T15:47:37.038098 #17739] INFO -- : [{"id"=>"l13e7", "id_data"=>[{"segment"=>nil, "metrics"=>{"impressions"=>nil, "billed_charge_local_micro"=>nil, "follows"=>nil, "retweets"=>nil, "likes"=>nil, "engagements"=>nil, "replies"=>nil, "billed_engagements"=>nil}}]}]
I, [2016-04-27T15:47:37.061924 #17739] INFO -- : [{"id"=>"ku1be", "id_data"=>[{"segment"=>nil, "metrics"=>{"impressions"=>nil, "billed_charge_local_micro"=>nil, "follows"=>nil, "retweets"=>nil, "likes"=>nil, "engagements"=>nil, "replies"=>nil, "billed_engagements"=>nil}}]}]
I, [2016-04-27T15:47:37.243915 #17739] INFO -- : [{"id"=>"kx6bb", "id_data"=>[{"segment"=>nil, "met
{"data"=>
[{"date_start"=>"2016-08-30",
"date_stop"=>"2016-09-28",
"account_id"=>"1378976532319552",
"account_name"=>"日本ロレアル/HDY",
"campaign_id"=>"6051654876004",
"campaign_name"=>"MAYBELLINE_HSL_video_fb_cv_160805_0905",
"adset_id"=>"6051654882204",
"adset_name"=>"MAYBELLINE_HSL_video_イベント_160805_0905",
"objective"=>"VIDEO_VIEWS",
@absyah
absyah / original
Last active December 19, 2016 09:49
line_item_auction_model = Twitter::Data::LineItemAuction.new Advertiser.find(875)
line_item_auction_model.refresh(["1w2gx", "1w2h0", "1w2h1", "1w2h3"], "DAY", "2014-12-25T00:00:00+09:00", "2015-01-01T00:00:00+09:00")
=> {"data"=>
[{"id"=>"1w2h1",
"metrics"=>
{"auction_win_rate"=>[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"average_bid_local_micro"=>[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"average_price_local_micro"=>[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]},
"start_time"=>"2014-12-25T00:00:00+09:00",