Skip to content

Instantly share code, notes, and snippets.

View absyah's full-sized avatar

Ardian Bahtiarsyah absyah

View GitHub Profile
@absyah
absyah / create_item.rb
Created August 30, 2017 09:22
Shopee Export
# url https://partner.staging.shopeemobile.com/api/v1/item/add
# headers
# {
# :"Content-type"=>"application/json",
# :Authorization=>"27b2a692fbcd1b4b97824479389b900680b5abb18c5b8a0e20004a6c1158eb99",
# :"cache-control"=>"no-cache"
# }
#
#
# response
@absyah
absyah / countries.txt
Last active August 17, 2017 13:58
List of countries
COUNTRIES = [
{name: 'Afghanistan', code: 'AF'},
{name: 'Aland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'Andorra', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@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",
{"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",
# 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
// 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
# 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_
.attachinary_container{
margin-top: 20px;
}
.attachinary_container ul{
padding-left:0px;
}
.attachinary_container ul li{
....................................................................*......*.*.........*.*.*......*.....*...............................................................................................................FF..................................................................................................................*..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................===== Creating instances =====
===== Finished to create instances =====
.===== Creating instances =====
===== Finished to create instances =====
.===== Creating instances =====
====
// # 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 =