Code Monkey home page Code Monkey logo

sem4r's Introduction

Sem4r

Sem4r is a ruby library to access google adwords api, that works with ruby 1.9 and 1.8.

The Google AdWords Api (code.google.com/apis/adwords/) is a webservice soap protocol. From the official site:

The Google AdWords API lets developers build applications that interact directly
with the AdWords platform. With these applications, advertisers and third
parties can more efficiently and creatively manage their large or complex
AdWords accounts and campaigns.

The official google adwords ruby library adwords4r doesn’t work with ruby 1.9, because uses soap4r. The soap4r is not supported by ruby 1.9. Sem4r don’t uses soap4r.

Main idea is to use a high level model instead of a low level api. You think about clients, campaigns, keywords and not about operations, operands, service calls. In the future, the library might decide which api use (sync or async) and when call it!

Usage

To access adwords api you need:

- email account  (for sandbox environment a gmail account <myaccount>@gmail.com)
- password       
- developer token (for sandbox environment is like <myaccount>@gmail.com++EUR)

To access the sandbox environment

adwords = Adwords.sandbox( :email => "<myaccount>@gmail.com", :password => "secret", :developer_token => "<myaccount>@gmail.com++EUR")

To print details about the current account:

adwords.account.p_info

You can list all client accounts:

adwords.account.p_clients

See directory examples_sem4r for more examples. Follow the sem4r.com feed for announcements of new releases.

Ruby Versions

Sem4r last gem was tested on following rubies:

  • 1.9.2-p0 - linux (works)

  • jruby 1.5.5 - linux (some example are not working, certificate verify failed OpenSSL in sandbox)

Install

sudo gem install sem4r

Api status

Campaign Data Management

  • CampaignService: …

  • CampaignTargetService: …

  • AdGroupService: …

  • AdGroupAdService: …

  • CampaignAdExtensionService: …

  • AdExtensionOverrideService: …

  • CampaignCriterionService: …

  • AdGroupCriterionService: …

  • AdParamService: …

  • UserListService: …

Optimization

  • BidLandscapeService: …

  • ReportDefinitionService

  • TargetingIdeaService

  • TrafficEstimatorService

Account Management

  • AlertService

  • CustomerSyncService

  • InfoService

  • ServicedAccountService

Utility

  • BulkMutateJobService

  • GeoLocationService

  • MediaService

How to submit a bug report

Contribute

So you want your prefered service supported by sem4r. Great! Please follow this steps:

  • Fork the project

  • Clone down your fork

  • Create a topic branch to contain your change ( git checkout -b my_awesome_feature )

  • Hack away, add tests. Not necessarily in that order.

  • Make sure rspec tests passes by running rake

  • Add an example of use of the new feature or service.

  • Make sure all examples run without errors. This will take some time. ( rake sem4r:examples )

  • If necessary, rebase your commits.

  • Push the branch up ( git push origin my_awesome_feature )

  • Send a pull request

Contributors

If I miss someone send me a note.

To see all contributors execute: git shortlog -n -s –no-merges

License

(The MIT License)

Copyright © 2009 - 2010 Sem4r

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

sem4r's People

Contributors

brennandunn avatar rromanchuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jonuts rromanchuk

sem4r's Issues

profile.rb:134:in `load_config': undefined local variable or method `config_file' for Sem4r::Profile:Class (NameError)

See http://pastie.org/1887899 -- I'm not sure what config file it's missing.

There is a ~/.sem4r/sem4r.yml with my credentials for sandbox and production. Is there config setup somewhere else that I'm missing?

I'm just trying to get the keyword ideas example to run on my Macbook, OSX Leopard when I get this error message. Ruby is: ruby-1.8.7-p334, gems version is (gem -v): 1.5.2

campaigns triggers common.rb:156:in `split': bad URI(is not URI?): (URI::InvalidURIError)

sem --config .sem4r/sem4r.yaml -p production campaigns
using production profile
config file is /Users/ryan/.sem4r/sem4r.yaml
Logging soap conversation to 'directory:/Users/ryan/.sem4r/20110526-soap-dump'
Logger is active
Collecting campaign from account(s) - please wait
look in account [email protected]'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/uri/common.rb:156:in `split': bad URI(is not URI?): (URI::InvalidURIError)

and

ruby-1.9.2-p0 > client.campaigns
nil<------------

URI::InvalidURIError: bad URI(is not URI?):
from /Users/ryan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/uri/common.rb:156:in split' from /Users/ryan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/uri/common.rb:174:inparse'
from /Users/ryan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/uri/common.rb:628:in parse' from /Users/ryan/.rvm/gems/ruby-1.9.2-p0@r3/bundler/gems/sem4r-75fdef5c832a/lib/sem4r_soap/http_connector.rb:160:insend'

def send(service_url, soap_action, request_xml)
        puts service_url.inspect + "<------------"
        uri     = URI.parse(service_url)

        headers = {
            "Content-Type"   => "text/xml; charset=utf-8",
            "Content-Length" => request_xml.length.to_s,
            "SOAPAction"     => soap_action}

        @logger.info("Post to #{uri.path} (#{soap_action})") if @logger
        dump_soap_request(service_url, request_xml)
        response = post(service_url, request_xml, headers)
        unless response
          raise Sem4rError, "Connection Error"
        end
        response_xml = response.content
        dump_soap_response(service_url, response_xml)
        response_xml
      end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.