Readme.txt in adwords4r-15.0.1 vs Readme.txt in adwords4r-15.1.0
- old
+ new
@@ -1,85 +1,83 @@
-Google adwords4r Library
--------------------------
+= Google adwords4r Library
Welcome to adwords4r: Bringing the delights of Ruby programming to the AdWords
world!
Documentation and comments are a work in progress.
-Useful Web Resources
---------------------
+= Useful Web Resources
-- AdWords home:
- https://adwords.google.com/
-- AdWords API discussion forum:
- http://groups.google.com/group/adwords-api
-- AdWords API documentation:
- http://code.google.com/apis/adwords/docs/developer/index.html
-- This project's Google Code page:
- http://code.google.com/p/google-api-adwords-ruby/
+- {AdWords home}[https://adwords.google.com/]
+- {AdWords API discussion forum}[http://groups.google.com/group/adwords-api]
+- {AdWords API documentation}[http://code.google.com/apis/adwords/docs/developer/index.html]
+- {This project's Google Code page}[http://code.google.com/p/google-api-adwords-ruby/]
-Docs for Users
---------------
+= Docs for Users
-1 - Instalation:
+== 1 - Instalation:
adwords4r is a ruby gem. See http://docs.rubygems.org/read/book/1
Install it using the gem install command.
-> gem install --local adwords4r
+ $ gem install --remote adwords4r
The following gem libraries are required:
- soap4r v1.5.8
- httpclient v2.1.2 or greater
-2 - Using the client library:
+== 2 - Using the client library:
It's pretty easy to use.
See http://docs.rubygems.org/read/chapter/3#page70 for how to set the rubygem
environment.
-export RUBYOPT=rubygems
-or ruby -rubygems my_program_that_uses_gems
+ $ export RUBYOPT=rubygems
+or
+ $ ruby -rubygems my_program_that_uses_gems
If you do not use the rubygems option, you need to add
-require 'rubygems'
+ require 'rubygems'
at the beginning of your programs.
Then:
-require 'adwords4r'
+ require 'adwords4r'
-adwords = AdWords::API.new
+ adwords = AdWords::API.new
creates a driver for the latest version of AdWords API using a credentials file
in ENV['HOME']/adwords.properties
There is an example credentials in the root adwords4r directory.
You can also pass API a manually constructed AdWordsCredentials object like:
-adwords = AdWords::API.new(AdWords::AdWordsCredentials.new({
- 'developerToken' => 'DEVELOPER_TOKEN',
- 'applicationToken' => 'APPLICATION_TOKEN',
- 'useragent' => 'Ruby Sample',
- 'password' => 'PASSWORD',
- 'email' => 'user@domain.com'
- 'clientEmail' => 'user2@domain.com',
-}))
+ adwords = AdWords::API.new(AdWords::AdWordsCredentials.new({
+ 'developerToken' => 'DEVELOPER_TOKEN',
+ 'applicationToken' => 'APPLICATION_TOKEN',
+ 'useragent' => 'Ruby Sample',
+ 'password' => 'PASSWORD',
+ 'email' => 'user@domain.com'
+ 'clientEmail' => 'user2@domain.com',
+ }))
Then, just specify which service you're looking to use, and which version:
-account_srv = adwords.get_service(13, 'Account')
+ account_srv = adwords.get_service(13, 'Account')
and you should now be able to just use the API methods in the object you were
returned:
-client_accounts = account_srv.getClientAccounts
+ client_accounts = account_srv.getClientAccounts
See the code in the examples directory for working examples you can build from.
+*Note*: if your setup requires you to send connections through a proxy server,
+please set the HTTP_PROXY environment variable. For example, from your code:
+ $ ENV['HTTP_PROXY'] = 'http://myproxyserver:8080'
-2.1 - Using the Sandbox:
+=== 2.1 - Using the Sandbox:
+
In order to use the v13 sandbox, you can add a credential named alternateUrl:
-alternateUrl=https://sandbox.google.com/api/adwords/v13/
+ alternateUrl=https://sandbox.google.com/api/adwords/v13/
As for v200902, the alternateUrl parameter is currently ignored, since only the
sandbox is available at the moment. For this API version, all requests will be
sent to the sandbox, using the "email" and "password" fields defined in the
credentials for authentication, and clientEmail for specifying which client
@@ -92,51 +90,57 @@
The multiple_versions.rb code sample shows you how to build an application using
v13 and v200902 services simultaneously.
-2.2 - Logging:
+=== 2.2 - Logging:
It is often useful to see a trace of the raw SOAP XML being sent and received.
The quickest way of achieving this when debugging your application is by setting
the ADWORDS4R_DEBUG environment variable to TRUE; e.g. in the bash shell:
-export ADWORDS4R_DEBUG=TRUE
+ $ export ADWORDS4R_DEBUG=TRUE
or from your Ruby code:
-ENV['ADWORDS4R_DEBUG'] = 'TRUE'
+ ENV['ADWORDS4R_DEBUG'] = 'TRUE'
This will output the SOAP XML to stderr, which will usually show up in your
terminal window.
There's also the option of logging requests and XML to files. In order to enable
this, you should use the write_to_file method of the loggers inside your
-AdWords::API object:
-adwords = AdWords::API.new
-adwords.unit_logger.log_to_file
-adwords.xml_logger.log_to_file
+ AdWords::API object:
+ adwords = AdWords::API.new
+ adwords.unit_logger.log_to_file
+ adwords.xml_logger.log_to_file
The first logs the units spent and the requests made, whereas the second logs
the full SOAP XML being sent and received over the wire. These will be written
to the current directory by default, but you can specify a path as an optional
parameter to log_to_file:
-adwords.unit_logger.log_to_file('/var/log/my_app')
-adwords.xml_logger.log_to_file('/var/log/my_app')
+ adwords.unit_logger.log_to_file('/var/log/my_app')
+ adwords.xml_logger.log_to_file('/var/log/my_app')
The files will be named request_info and soap_xml, respectively.
-Docs for Developers
--------------------
+= Docs for Developers
-rake getwsdl
- to get the wsdl files
-rake generate
- to regenerate the bindings if needed
-rake package
- to package the gem and create a release
+ $ rake getwsdl
+to get the wsdl files
+ $ rake generate
+to regenerate the bindings if needed
-Copyright/License Info
-----------------------
+ $ rake rdoc
+to regenerate the project documentation if needed
+
+ $ rake package
+to package the gem and create a release
+
+ $ rake test
+to run unit tests on the library
+
+
+= Copyright/License Info
Copyright 2009, Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.