adwords4r 12.0.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/ChangeLog.txt +4 -0
  2. data/Rakefile +1 -1
  3. data/Readme.txt +2 -2
  4. data/adwords.properties +1 -1
  5. data/examples/account_info.rb +131 -0
  6. data/examples/create_all.rb +165 -0
  7. data/examples/keyword_suggestions.rb +2 -2
  8. data/examples/reports.rb +2 -2
  9. data/lib/adwords4r/credentials.rb +11 -0
  10. data/lib/adwords4r/services.rb +0 -2
  11. metadata +24 -60
  12. data/examples/campaign.rb +0 -40
  13. data/examples/framework.rb +0 -8
  14. data/examples/get_free_usage_this_month.rb +0 -20
  15. data/examples/get_unit_count.rb +0 -21
  16. data/examples/keyword_tool_demo.rb +0 -31
  17. data/examples/traffic_estimator.rb +0 -34
  18. data/lib/adwords4r/v11/AccountService.rb +0 -215
  19. data/lib/adwords4r/v11/AccountServiceDriver.rb +0 -69
  20. data/lib/adwords4r/v11/AccountServiceMappingRegistry.rb +0 -243
  21. data/lib/adwords4r/v11/AdGroupService.rb +0 -257
  22. data/lib/adwords4r/v11/AdGroupServiceDriver.rb +0 -109
  23. data/lib/adwords4r/v11/AdGroupServiceMappingRegistry.rb +0 -276
  24. data/lib/adwords4r/v11/AdService.rb +0 -760
  25. data/lib/adwords4r/v11/AdServiceDriver.rb +0 -125
  26. data/lib/adwords4r/v11/AdServiceMappingRegistry.rb +0 -807
  27. data/lib/adwords4r/v11/CampaignService.rb +0 -443
  28. data/lib/adwords4r/v11/CampaignServiceDriver.rb +0 -125
  29. data/lib/adwords4r/v11/CampaignServiceMappingRegistry.rb +0 -564
  30. data/lib/adwords4r/v11/CriterionService.rb +0 -442
  31. data/lib/adwords4r/v11/CriterionServiceDriver.rb +0 -117
  32. data/lib/adwords4r/v11/CriterionServiceMappingRegistry.rb +0 -507
  33. data/lib/adwords4r/v11/InfoService.rb +0 -242
  34. data/lib/adwords4r/v11/InfoServiceDriver.rb +0 -109
  35. data/lib/adwords4r/v11/InfoServiceMappingRegistry.rb +0 -228
  36. data/lib/adwords4r/v11/KeywordToolService.rb +0 -205
  37. data/lib/adwords4r/v11/KeywordToolServiceDriver.rb +0 -61
  38. data/lib/adwords4r/v11/KeywordToolServiceMappingRegistry.rb +0 -227
  39. data/lib/adwords4r/v11/ReportService.rb +0 -322
  40. data/lib/adwords4r/v11/ReportServiceDriver.rb +0 -101
  41. data/lib/adwords4r/v11/ReportServiceMappingRegistry.rb +0 -298
  42. data/lib/adwords4r/v11/SiteSuggestionService.rb +0 -242
  43. data/lib/adwords4r/v11/SiteSuggestionServiceDriver.rb +0 -77
  44. data/lib/adwords4r/v11/SiteSuggestionServiceMappingRegistry.rb +0 -271
  45. data/lib/adwords4r/v11/TrafficEstimatorService.rb +0 -312
  46. data/lib/adwords4r/v11/TrafficEstimatorServiceDriver.rb +0 -77
  47. data/lib/adwords4r/v11/TrafficEstimatorServiceMappingRegistry.rb +0 -483
  48. data/svn-commit.2.tmp +0 -60
  49. data/svn-commit.tmp +0 -60
data/examples/campaign.rb DELETED
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Use adwords4r in parent dir
4
- $LOAD_PATH.unshift '../lib/'
5
-
6
- require 'adwords4r'
7
-
8
- SEP = "---"
9
-
10
- def dumpObj(o)
11
- str = ""
12
- o.instance_variables.each { |v| str << dumpAttr(o, v)}
13
- return str << SEP
14
- end
15
-
16
- def dumpAttr(o, v)
17
- name = v.sub(/@/,'')
18
- value = eval("o.#{name}.to_s")
19
- return "#{name}: #{value}\n"
20
- end
21
-
22
- begin
23
- adwords = AdWords::API.new
24
-
25
- res = adwords.getAllAdWordsCampaigns(123).getAllAdWordsCampaignsReturn
26
- res.each {|c| puts dumpObj(c)}
27
-
28
- c = AdWords::Campaign.new
29
- c.dailyBudget = 10000
30
- c.status = 'Paused'
31
- c.name = "Test Campaign #{rand(10000)}"
32
- c.endDay = SOAP::SOAPDate.new("2010-01-01")
33
- puts dumpObj(adwords.addCampaign(c).addCampaignReturn)
34
-
35
- rescue AdWords::Error::UnknownAPICall => e
36
- puts e
37
- rescue AdWords::Error::ApiError => e
38
- puts e.code
39
- puts e.message
40
- end
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Use adwords4r in parent dir
4
- $LOAD_PATH.unshift '../lib/'
5
-
6
- require 'adwords4r'
7
-
8
- adwords = AdWords::API.new
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Use adwords4r in parent dir
4
- $LOAD_PATH.unshift '../lib/'
5
-
6
- require 'adwords4r'
7
-
8
- begin
9
- adwords = AdWords::API.new
10
- result = adwords.getFreeUsageQuotaThisMonth().
11
- getFreeUsageQuotaThisMonthReturn
12
- puts "result = #{result}"
13
-
14
- rescue AdWords::Error::UnknownAPICall => e
15
- puts e
16
- rescue AdWords::Error::ApiError => e
17
- puts e.code
18
- puts e.message
19
- end
20
-
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Use adwords4r in parent dir
4
- $LOAD_PATH.unshift '../lib/'
5
-
6
- require 'adwords4r'
7
-
8
- begin
9
- adwords = AdWords::API.new
10
- # Get the units for the last month or so
11
- end = Date.today
12
- start = end_date - 31
13
- puts "result = #{adwords.getUnitCount(start, end).getUnitCountReturn}"
14
-
15
- rescue AdWords::Error::UnknownAPICall => e
16
- puts e
17
- rescue AdWords::Error::ApiError => e
18
- puts e.code
19
- puts e.message
20
- end
21
-
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Use adwords4r in parent dir
4
- $LOAD_PATH.unshift '../lib/'
5
-
6
- require 'adwords4r'
7
-
8
- def printkw(kw, gname)
9
- puts "#{gname} #{kw.advertiserCompetitionScale} " +
10
- "#{kw.searchVolumeScale} #{kw.text}"
11
- end
12
-
13
- begin
14
- if (ARGV.length < 1)
15
- puts "Usage: #$0 <url>"
16
- exit
17
- end
18
- adwords = AdWords::API.new
19
- result = adwords.getKeywordsFromSite(ARGV[0], true, [], [])
20
- groups = result.getKeywordsFromSiteReturn.groups
21
- kws = result.getKeywordsFromSiteReturn.keywords
22
- puts "GroupName AdvertiserCompetitionScale searchVolumeScale text"
23
- kws.each {|kw| printkw(kw, groups[kw.groupId.to_i])}
24
-
25
- rescue AdWords::Error::UnknownAPICall => e
26
- puts e
27
- rescue AdWords::Error::ApiError => e
28
- puts e.code
29
- puts e.message
30
- end
31
-
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Use adwords4r in parent dir
4
- $LOAD_PATH.unshift '../lib/'
5
-
6
- require 'adwords4r'
7
-
8
- SEP = "---"
9
-
10
- def dumpObj(o)
11
- str = ""
12
- o.instance_variables.each { |v| str << dumpAttr(o, v)}
13
- return str << SEP
14
- end
15
-
16
- def dumpAttr(o, v)
17
- name = v.sub(/@/,'')
18
- value = eval("o.#{name}.to_s")
19
- return "#{name}: #{value}\n"
20
- end
21
-
22
- begin
23
- adwords = AdWords::API.new
24
-
25
- res = adwords.estimateKeywordList([AdWords::KeywordRequest.new(
26
- nil, 50000, false, 'flowers', 'Broad')]).estimateKeywordListReturn
27
- res.each {|c| puts dumpObj(c)}
28
-
29
- rescue AdWords::Error::UnknownAPICall => e
30
- puts e
31
- rescue AdWords::Error::ApiError => e
32
- puts e.code
33
- puts e.message
34
- end
@@ -1,215 +0,0 @@
1
- require 'xsd/qname'
2
-
3
- module AdWords; module AccountService
4
-
5
-
6
- # {https://adwords.google.com/api/adwords/v11}AccountInfo
7
- # billingAddress - AdWords::AccountService::Address
8
- # currencyCode - SOAP::SOAPString
9
- # customerId - SOAP::SOAPLong
10
- # defaultNetworkTargeting - AdWords::AccountService::NetworkTarget
11
- # descriptiveName - SOAP::SOAPString
12
- # emailPromotionsPreferences - AdWords::AccountService::EmailPromotionsPreferences
13
- # languagePreference - SOAP::SOAPString
14
- # primaryAddress - AdWords::AccountService::Address
15
- # primaryBusinessCategory - SOAP::SOAPString
16
- # timeZoneEffectiveDate - SOAP::SOAPLong
17
- # timeZoneId - SOAP::SOAPString
18
- class AccountInfo
19
- attr_accessor :billingAddress
20
- attr_accessor :currencyCode
21
- attr_accessor :customerId
22
- attr_accessor :defaultNetworkTargeting
23
- attr_accessor :descriptiveName
24
- attr_accessor :emailPromotionsPreferences
25
- attr_accessor :languagePreference
26
- attr_accessor :primaryAddress
27
- attr_accessor :primaryBusinessCategory
28
- attr_accessor :timeZoneEffectiveDate
29
- attr_accessor :timeZoneId
30
-
31
- def initialize(billingAddress = nil, currencyCode = nil, customerId = nil, defaultNetworkTargeting = nil, descriptiveName = nil, emailPromotionsPreferences = nil, languagePreference = nil, primaryAddress = nil, primaryBusinessCategory = nil, timeZoneEffectiveDate = nil, timeZoneId = nil)
32
- @billingAddress = billingAddress
33
- @currencyCode = currencyCode
34
- @customerId = customerId
35
- @defaultNetworkTargeting = defaultNetworkTargeting
36
- @descriptiveName = descriptiveName
37
- @emailPromotionsPreferences = emailPromotionsPreferences
38
- @languagePreference = languagePreference
39
- @primaryAddress = primaryAddress
40
- @primaryBusinessCategory = primaryBusinessCategory
41
- @timeZoneEffectiveDate = timeZoneEffectiveDate
42
- @timeZoneId = timeZoneId
43
- end
44
- end
45
-
46
- # {https://adwords.google.com/api/adwords/v11}Address
47
- # addressLine1 - SOAP::SOAPString
48
- # addressLine2 - SOAP::SOAPString
49
- # city - SOAP::SOAPString
50
- # companyName - SOAP::SOAPString
51
- # countryCode - SOAP::SOAPString
52
- # emailAddress - SOAP::SOAPString
53
- # faxNumber - SOAP::SOAPString
54
- # name - SOAP::SOAPString
55
- # phoneNumber - SOAP::SOAPString
56
- # postalCode - SOAP::SOAPString
57
- # state - SOAP::SOAPString
58
- class Address
59
- attr_accessor :addressLine1
60
- attr_accessor :addressLine2
61
- attr_accessor :city
62
- attr_accessor :companyName
63
- attr_accessor :countryCode
64
- attr_accessor :emailAddress
65
- attr_accessor :faxNumber
66
- attr_accessor :name
67
- attr_accessor :phoneNumber
68
- attr_accessor :postalCode
69
- attr_accessor :state
70
-
71
- def initialize(addressLine1 = nil, addressLine2 = nil, city = nil, companyName = nil, countryCode = nil, emailAddress = nil, faxNumber = nil, name = nil, phoneNumber = nil, postalCode = nil, state = nil)
72
- @addressLine1 = addressLine1
73
- @addressLine2 = addressLine2
74
- @city = city
75
- @companyName = companyName
76
- @countryCode = countryCode
77
- @emailAddress = emailAddress
78
- @faxNumber = faxNumber
79
- @name = name
80
- @phoneNumber = phoneNumber
81
- @postalCode = postalCode
82
- @state = state
83
- end
84
- end
85
-
86
- # {https://adwords.google.com/api/adwords/v11}ApiError
87
- # code - SOAP::SOAPInt
88
- # detail - SOAP::SOAPString
89
- # field - SOAP::SOAPString
90
- # index - SOAP::SOAPInt
91
- # isExemptable - SOAP::SOAPBoolean
92
- # textIndex - SOAP::SOAPInt
93
- # textLength - SOAP::SOAPInt
94
- # trigger - SOAP::SOAPString
95
- class ApiError
96
- attr_accessor :code
97
- attr_accessor :detail
98
- attr_accessor :field
99
- attr_accessor :index
100
- attr_accessor :isExemptable
101
- attr_accessor :textIndex
102
- attr_accessor :textLength
103
- attr_accessor :trigger
104
-
105
- def initialize(code = nil, detail = nil, field = nil, index = nil, isExemptable = nil, textIndex = nil, textLength = nil, trigger = nil)
106
- @code = code
107
- @detail = detail
108
- @field = field
109
- @index = index
110
- @isExemptable = isExemptable
111
- @textIndex = textIndex
112
- @textLength = textLength
113
- @trigger = trigger
114
- end
115
- end
116
-
117
- # {https://adwords.google.com/api/adwords/v11}ApiException
118
- # code - SOAP::SOAPInt
119
- # errors - AdWords::AccountService::ApiError
120
- # internal - SOAP::SOAPBoolean
121
- # message - SOAP::SOAPString
122
- # trigger - SOAP::SOAPString
123
- class ApiException
124
- attr_accessor :code
125
- attr_accessor :errors
126
- attr_accessor :internal
127
- attr_accessor :message
128
- attr_accessor :trigger
129
-
130
- def initialize(code = nil, errors = [], internal = nil, message = nil, trigger = nil)
131
- @code = code
132
- @errors = errors
133
- @internal = internal
134
- @message = message
135
- @trigger = trigger
136
- end
137
- end
138
-
139
- # {https://adwords.google.com/api/adwords/v11}EmailPromotionsPreferences
140
- # accountPerformanceEnabled - SOAP::SOAPBoolean
141
- # disapprovedAdsEnabled - SOAP::SOAPBoolean
142
- # marketResearchEnabled - SOAP::SOAPBoolean
143
- # newsletterEnabled - SOAP::SOAPBoolean
144
- # promotionsEnabled - SOAP::SOAPBoolean
145
- class EmailPromotionsPreferences
146
- attr_accessor :accountPerformanceEnabled
147
- attr_accessor :disapprovedAdsEnabled
148
- attr_accessor :marketResearchEnabled
149
- attr_accessor :newsletterEnabled
150
- attr_accessor :promotionsEnabled
151
-
152
- def initialize(accountPerformanceEnabled = nil, disapprovedAdsEnabled = nil, marketResearchEnabled = nil, newsletterEnabled = nil, promotionsEnabled = nil)
153
- @accountPerformanceEnabled = accountPerformanceEnabled
154
- @disapprovedAdsEnabled = disapprovedAdsEnabled
155
- @marketResearchEnabled = marketResearchEnabled
156
- @newsletterEnabled = newsletterEnabled
157
- @promotionsEnabled = promotionsEnabled
158
- end
159
- end
160
-
161
- # {https://adwords.google.com/api/adwords/v11}NetworkTarget
162
- class NetworkTarget < ::Array
163
- end
164
-
165
- # {https://adwords.google.com/api/adwords/v11}NetworkType
166
- class NetworkType < ::String
167
- ContentNetwork = NetworkType.new("ContentNetwork")
168
- GoogleSearch = NetworkType.new("GoogleSearch")
169
- SearchNetwork = NetworkType.new("SearchNetwork")
170
- end
171
-
172
- # {https://adwords.google.com/api/adwords/v11}getAccountInfo
173
- class GetAccountInfo
174
- def initialize
175
- end
176
- end
177
-
178
- # {https://adwords.google.com/api/adwords/v11}getAccountInfoResponse
179
- # getAccountInfoReturn - AdWords::AccountService::AccountInfo
180
- class GetAccountInfoResponse
181
- attr_accessor :getAccountInfoReturn
182
-
183
- def initialize(getAccountInfoReturn = nil)
184
- @getAccountInfoReturn = getAccountInfoReturn
185
- end
186
- end
187
-
188
- # {https://adwords.google.com/api/adwords/v11}getClientAccounts
189
- class GetClientAccounts
190
- def initialize
191
- end
192
- end
193
-
194
- # {https://adwords.google.com/api/adwords/v11}getClientAccountsResponse
195
- class GetClientAccountsResponse < ::Array
196
- end
197
-
198
- # {https://adwords.google.com/api/adwords/v11}updateAccountInfo
199
- # accountInfo - AdWords::AccountService::AccountInfo
200
- class UpdateAccountInfo
201
- attr_accessor :accountInfo
202
-
203
- def initialize(accountInfo = nil)
204
- @accountInfo = accountInfo
205
- end
206
- end
207
-
208
- # {https://adwords.google.com/api/adwords/v11}updateAccountInfoResponse
209
- class UpdateAccountInfoResponse
210
- def initialize
211
- end
212
- end
213
-
214
-
215
- end; end
@@ -1,69 +0,0 @@
1
- require 'adwords4r/v11/AccountService'
2
- require 'adwords4r/v11/AccountServiceMappingRegistry'
3
- require 'soap/rpc/driver'
4
-
5
- module AdWords
6
- module AccountService
7
-
8
- class AccountInterface < ::SOAP::RPC::Driver
9
- DefaultEndpointUrl = "https://adwords.google.com/api/adwords/v11/AccountService"
10
-
11
- Methods = [
12
- [ "",
13
- "getAccountInfo",
14
- [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v11", "getAccountInfo"]],
15
- ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v11", "getAccountInfoResponse"]] ],
16
- { :request_style => :document, :request_use => :literal,
17
- :response_style => :document, :response_use => :literal,
18
- :faults => {"AdWords::AccountService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :ns=>"https://adwords.google.com/api/adwords/v11", :name=>"ApiException", :namespace=>nil}} }
19
- ],
20
- [ "",
21
- "getClientAccounts",
22
- [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v11", "getClientAccounts"]],
23
- ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v11", "getClientAccountsResponse"]] ],
24
- { :request_style => :document, :request_use => :literal,
25
- :response_style => :document, :response_use => :literal,
26
- :faults => {"AdWords::AccountService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :ns=>"https://adwords.google.com/api/adwords/v11", :name=>"ApiException", :namespace=>nil}} }
27
- ],
28
- [ "",
29
- "updateAccountInfo",
30
- [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v11", "updateAccountInfo"]],
31
- ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v11", "updateAccountInfoResponse"]] ],
32
- { :request_style => :document, :request_use => :literal,
33
- :response_style => :document, :response_use => :literal,
34
- :faults => {"AdWords::AccountService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :ns=>"https://adwords.google.com/api/adwords/v11", :name=>"ApiException", :namespace=>nil}} }
35
- ]
36
- ]
37
-
38
- def initialize(endpoint_url = nil)
39
- endpoint_url ||= DefaultEndpointUrl
40
- super(endpoint_url, nil)
41
- self.mapping_registry = DefaultMappingRegistry::EncodedRegistry
42
- self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry
43
- init_methods
44
- end
45
-
46
- private
47
-
48
- def init_methods
49
- Methods.each do |definitions|
50
- opt = definitions.last
51
- if opt[:request_style] == :document
52
- add_document_operation(*definitions)
53
- else
54
- add_rpc_operation(*definitions)
55
- qname = definitions[0]
56
- name = definitions[2]
57
- if qname.name != name and qname.name.capitalize == name.capitalize
58
- ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
59
- __send__(name, *arg)
60
- end
61
- end
62
- end
63
- end
64
- end
65
- end
66
-
67
-
68
- end
69
- end