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
public void SetDeco(Color decoColor, string attachmentPrefix) { | |
foreach(Spine.Slot slot in this.spineAnim.Skeleton.Slots) { | |
if(slot.Data.Name.StartsWith(BodyPartFactory.DECO_SLOT_PREFIX)) { | |
Spine.Attachment attachment = GetAttachment(attachmentPrefix); | |
slot.Attachment = attachment; | |
slot.SetColor(decoColor); | |
} | |
} | |
} |
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
def get_target(interest_id, interest_name) | |
account_id = @account_id | |
access_token = @access_token | |
url = "https://graph.facebook.com/v2.10/act_#{account_id}/reachestimate" | |
params = { | |
"access_token" => access_token, | |
"targeting_spec" => "{" + | |
"\"geo_locations\": {\"country_groups\":[\"Worldwide\"]}," + | |
" \"age_min\": 20, \"age_max\": 40," + |
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
{ | |
"error": { | |
"message": "Unsupported post request. Object with ID <ACCOUNT_ID> does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", | |
"type": "GraphMethodException", | |
"code": 100, | |
"fbtrace_id": "ESJks9/KxJC" | |
} | |
} |
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 'net/http' | |
require 'uri' | |
require "erb" | |
include ERB::Util | |
class FacebookApi | |
def get_target() | |
account_id = <ACCOUNT_ID> | |
access_token = <USER_ACCESS_TOKEN_WITH_ADS_MANAGEMENT_PRIVILEGE> | |
uri = URI.parse("https://graph.facebook.com/v2.10/act_#{account_id}/reachestimate") |
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 "facebook_ads" | |
class FacebookApi | |
attr_reader :ad_instance | |
def initialize(opts={}) | |
@ad_instance = FacebookAds::AdAccount.get("act_#{opts[:account_id]}") | |
raise 'Account ID Key must be provided' unless opts[:account_id] | |
end |