Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fake_fb_marketing_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fake_fb_marketing_api

  • 0.0.7
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

FakeFbMarketingApi

This sinatra server provides a reverse proxy to the Facebook graph API at graph.facebook.com.

Select APIs can intercepted and return static responses.

Setup

Koala

These instructions assume that you are using Koala as your interface to the Facebook graph API.

In order to use this reverse proxy, you will need to redirect all Koala requests to your local fake-fb-marketing-api server.

In your Koala config, replace the URL for FB:

Koala.configure do |config|
  if Rails.env.development?
    config.graph_server = 'localhost:9292'
  end
end

In your Koala config, you will also need to disable SSL since our local server is not running with certificates:

Koala.http_service.http_options = {
  use_ssl: false
}

You will also need to set several ENV variables:

export FACEBOOK_AD_ACCOUNT_ID='xxxxxx' 
export BRAND_AWARENESS_CAMPAIGN_ID='xxxxxx' 
export LINK_CLICKS_CAMPAIGN_ID='xxxxxx' 
export VIDEO_VIEWS_CAMPAIGN_ID='xxxxxx' 
export REACH_CAMPAIGN_ID='xxxxxx' 
export POST_ENGAGEMENT_CAMPAIGN_ID='xxxxxx' 
export PAGE_LIKES_CAMPAIGN_ID='xxxxxx' 

It may be easier to run foreman with a separate ENV file that will set these values:

foreman start --f Procfile.dev --env fake.env

Note Foreman is particular about the format of the ENV file and does not support dot_env format (comments, etc.). This prevents us from using our normal .env.development to set variables for the entiree process.

Any calls that create an ad account will return the value in the FACEBOOK_AD_ACCOUNT_ID.

Any campaigns created will return the value in the XXX_CAMPAIGN_ID variables.

Notes

Development

Test

Staging

Production

Limitations

This server forwards all web requests via a Faraday wrapper. It does not support keep-alive Connection header.

FAQs

Package last updated on 09 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc