Facebook Marketing API (ads) for Ruby on Rails - ruby-on-rails

I want to create a rails application that can create facebooks ads automatically. So I need to use the Facebook Marketing Api.
It seems that there are a lot of ressources for the Graph Api but I didn't find simple ressources for the Marketing Api. I only found Php and Python on Facebook website.
I found some rails gems but there is no documentation and they don't seem to be well updated.
https://github.com/oguzcanhuner/eucalyptus
https://github.com/moviepilot/zuck
I'm not a confirmed developper and I need some help/ressources to start this.
How am i supposed to do that ? Is there someone who managed to do it ? or someone that used these gems ?
Any help is appreciated, thank you in advance !

Facebook has released their in house/official facebookads gem last month to facilitate application development for Facebook Ads API using Ruby.
You can see the complete documentation for the same here.
facebookads gem covers all features in more detail as compared to the earlier gem facebook_ads.
I will suggest you go for official facebookads gem as it is just released, code quality and feature coverage is better and ofcourse it being official gem will have better support.
The best thing is facebook also have released exact same sdk in other languages also(for python), so it makes it very easy if you have build exact same functionality in some other language or if you are porting your application from some other language. In my case i am porting from python to ruby and found that both the sdk's allow using Facebook Ads API in exactly similar fashion and even project structure is also exactly the same :)
Hope it helps!

You can use the facebook_ads gem:
gem install facebook_ads
Or
gem 'facebook_ads', '~> 0.1'
The documentation is available here.

Related

Is it possible to use piwik with Rails 4.2 and postgres

I am looking for an open source web analytic for my Rails 4.2 app, so after some research I found that piwik fit my needs. can I use "piwik" with postgresql ? it seems that they only support mysql but I am not sure if it still true at this moment!
also I've found a post about how to integrate it within Rails here but they use piwik_analytics which is a Gem for Ruby on Rails 3.x and may not work with 4.2 !
All the information I've found are a little outdated and I am not sure if there is a way to make it work with my current requirements. any help please ?
Piwik supports only MySQL, that's true
You don't need any gem because Piwik just needs to load some Javascript that needs to be embedded into your layout/views. The Rails app doesn't directly interact with it, only your visitors' browser. Which also means that it shouldn't matter whether it supports Postgres because it will most likely run on another machine as your Rails app.
Edit:
Regarding the gem you mentioned: I looked at it, too, when adding Piwik analytics to my app, but in the end went with writing the few required lines of JS myself.

Old version of recaptcha get displayed instead of the newer version using the rails gem "Recaptcha"

Thanks to the gem https://github.com/ambethia/recaptcha/ (version 0.3.6), I managed to integrate Google Recaptcha into my rails app. The problem is that only the old version (V1) is displayed, similar to below.
However, I would prefer to the newer version with the checkbox like below, which is much easier for the users. Any idea how to get there?
There is some discussion about this, see: https://github.com/ambethia/recaptcha/issues/112
You are free to implement the new API by yourself it's not that hard actually, and if you have the knowledge submit a pull request to the original repository with a working solution :-)
The instructions on how to implement reCaptcha can be found here: http://www.google.com/recaptcha/intro/index.html

What is the easiest way to work with Google Docs API in Ruby on Rails?

What is the easiest way to work with the Google Docs API in a Ruby on Rails application? Is there a gem available?
I did find this page: Google Data on Rails, is it the most up to date resource?
The google data rails on page is really out of date, at least in a ruby 1.9.3 environment its non useful.
Having a play with the google_drive gem now....
https://github.com/gimite/google-drive-ruby#readme
I was able to get it to work by simply installing it and pasting the readme code into a file. What more can you ask for!?
You can also Bearer universal API client available in Ruby.
This way you can query Google Docs API very easily and don't even have to worry about OAuth or refresh tokens: https://www.bearer.sh/integrations/33/google-docs-api
The Google Docs developers have now released their own gem to work with the API. Here's a guide to getting started: https://developers.google.com/sheets/api/quickstart/ruby
And the gem itself can be downloaded in the normal way from Rubygems: gem install google-api-client
There's more information in the Readme for the gem's source code repository: https://github.com/google/google-api-ruby-client
you can use this gem omniauth-google-oauth2. Make configuration with consumer-key and secret-key. Add gem in Gemfile. Follow github.

Rails 3 / PhoneGap: Converting a Rails app into an Phonegap iOS app?

I have a site built on top of Rails. In essence, I want to release a lightweight version of it for the appstore, and I think Phonegap is a good solution w/o writing a full iOS application.
What would be the easiest way to get something like this out of the door? I'm new to PhoneGap and would love if an experience dev could shed some light on how with is done. I feel it would also be a valuable resource for many other Rails devs.
My rails 3 app uses devise for authenication, carrierwave for file processing, amazon S3 for storage, and Heroku for hosting. Can someone give me some basic insight into how all these components are wrapped up and ablwe to be used with PhoneGap?
I'm new to Phonegap too, but I'm exploring the same idea than you and I've found this useful screencast: "PhoneGap + Rails 3 API"
http://vimeo.com/18763953
The idea is that you make an HTML5 client side app that makes calls to a Rails API on the server side.
Here is the code of the screencast demo:
https://github.com/quickleft/kbomb_phonegap_server (Rails API)
https://github.com/quickleft/kbomb_phonegap_client (HTML5 client with
Phonegap).
Hope it helps!
I think it could be relevant to check my phonegap-rails gem gem and my example rails / ember.js App that is exported with Phonegap. It also implements token authentication based on ember-auth and several OAuth strategies on top of Devise.
Currently in de the devel branch: https://github.com/joscas/base_app/tree/devel
Heroku deploy: https://starter-app-staging.herokuapp.com (the desktop version)
The gem exports assets, fixes paths etc. to allow seamless export of single page apps based on a rails backend.
At 37 Signals they rendered their html SERVER SIDE and just created an app wrapper. Here's the article: https://signalvnoise.com/posts/3743-hybrid-sweet-spot-native-navigation-web-content
This is an important difference in most approaches as most will re-develop their front end using a client side framework and it has the potential to save users a bunch of time. The downside is that I've heard rumors you can't get into the iOS app store, but it doesn't seem like they had a problem with it. There's also services like GoNative.io that will wrap your app for you.
A video and code that does something similar to Javi's answer can be found at
Using Phonegap as a native container for a Rails 3 App

What's the best gem to develop a Facebook Canvas/iFrame App (Rails 3.1.1, Ruby 1.9.2)?

I want to built a facebook canvas iFrame App. I tried to use facebooker but it does not work with rails 3. Can anybody suggest what gem I should use? If possible, please also provide a reference to a tutorial that can help me get started.
I would recommend fb_graph gem. The sample app code can be found at https://github.com/nov/fb_graph_sample.

Resources