sem4r 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +11 -0
- data/Gemfile.lock +36 -0
- data/README.rdoc +30 -0
- data/Rakefile +15 -12
- data/VERSION.yml +1 -1
- data/examples_blog/2009-11-29-hello-world.rb +0 -1
- data/examples_sem4r/01_get_account.rb +1 -1
- data/examples_sem4r/02_get_info.rb +6 -2
- data/examples_sem4r/03_list_ad.rb +1 -1
- data/examples_sem4r/04_list_keywords.rb +1 -1
- data/examples_sem4r/05_request_report.rb +1 -2
- data/examples_sem4r/05_request_report_2010.rb +19 -4
- data/examples_sem4r/06_create_campaigns.rb +1 -1
- data/examples_sem4r/07_create_campaigns_block.rb +1 -1
- data/examples_sem4r/07_create_campaigns_simple.rb +1 -1
- data/examples_sem4r/08_ad_params.rb +1 -1
- data/examples_sem4r/09_targeting_idea.rb +1 -1
- data/examples_sem4r/10_get_location.rb +1 -1
- data/examples_sem4r/11_submit_bulk_job.rb +1 -1
- data/examples_sem4r/12_list_bulk_job.rb +1 -1
- data/examples_sem4r/30_prune_empty_adgroup.rb +1 -1
- data/examples_sem4r/31_empty_accounts.rb +1 -1
- data/examples_sem4r/example_helper.rb +5 -10
- data/lib/sem4r/account.rb +3 -306
- data/lib/sem4r/ad_group/ad_group.rb +16 -14
- data/lib/sem4r/ad_group/ad_group_bids.rb +11 -10
- data/lib/sem4r/ad_group/ad_group_service.rb +5 -5
- data/lib/sem4r/ad_group_ad/ad_group_ad.rb +1 -1
- data/lib/sem4r/ad_group_ad/ad_group_ad_service.rb +5 -5
- data/lib/sem4r/ad_group_ad/ad_group_mobile_ad.rb +9 -9
- data/lib/sem4r/ad_group_ad/ad_group_text_ad.rb +9 -9
- data/lib/sem4r/ad_group_criterion/ad_group_criterion.rb +6 -6
- data/lib/sem4r/ad_group_criterion/ad_group_criterion_bids.rb +5 -6
- data/lib/sem4r/ad_group_criterion/ad_group_criterion_operations.rb +0 -1
- data/lib/sem4r/ad_group_criterion/ad_group_criterion_service.rb +4 -4
- data/lib/sem4r/ad_group_criterion/criterion.rb +3 -3
- data/lib/sem4r/ad_group_criterion/criterion_keyword.rb +3 -3
- data/lib/sem4r/ad_group_criterion/criterion_placement.rb +2 -2
- data/lib/sem4r/ad_param/ad_param.rb +3 -3
- data/lib/sem4r/ad_param/ad_param_service.rb +5 -5
- data/lib/sem4r/adwords.rb +1 -0
- data/lib/sem4r/api_counters.rb +1 -0
- data/lib/sem4r/base.rb +1 -0
- data/lib/sem4r/bulk_mutate_job/bulk_mutate_job.rb +2 -2
- data/lib/sem4r/bulk_mutate_job/bulk_mutate_job_account_extension.rb +59 -0
- data/lib/sem4r/bulk_mutate_job/bulk_mutate_job_service.rb +5 -5
- data/lib/sem4r/campaign/campaign.rb +10 -10
- data/lib/sem4r/campaign/campaign_account_extension.rb +87 -0
- data/lib/sem4r/campaign/campaign_service.rb +6 -6
- data/lib/sem4r/campaign_target/campaign_target_service.rb +22 -22
- data/lib/sem4r/cli/cli_command.rb +1 -0
- data/lib/sem4r/cli/cli_common_args.rb +10 -3
- data/lib/sem4r/cli/cli_helpers.rb +1 -0
- data/lib/sem4r/cli/cli_sem.rb +1 -0
- data/lib/sem4r/cli/{cli_download_report.rb → commands/cli_download_report.rb} +2 -1
- data/lib/sem4r/cli/{cli_ideas.rb → commands/cli_ideas.rb} +1 -0
- data/lib/sem4r/cli/{cli_commands.rb → commands/cli_info.rb} +3 -23
- data/lib/sem4r/cli/{cli_list_ads.rb → commands/cli_list_ads.rb} +1 -0
- data/lib/sem4r/cli/commands/cli_list_campaign.rb +35 -0
- data/lib/sem4r/cli/commands/cli_list_client.rb +36 -0
- data/lib/sem4r/cli/{cli_list_keywords.rb → commands/cli_list_keywords.rb} +1 -0
- data/lib/sem4r/cli/commands/cli_list_report.rb +34 -0
- data/lib/sem4r/cli/commands/cli_repdef.rb +109 -0
- data/lib/sem4r/cli/commands/cli_report.rb +78 -0
- data/lib/sem4r/cli/{cli_request_report.rb → commands/cli_request_report.rb} +1 -0
- data/lib/sem4r/credentials.rb +1 -0
- data/lib/sem4r/extensions.rb +22 -1
- data/lib/sem4r/geo_location/geo_location_account_extension.rb +43 -0
- data/lib/sem4r/geo_location/geo_location_service.rb +4 -4
- data/lib/sem4r/info/info_account_extension.rb +48 -0
- data/lib/sem4r/info/info_selector.rb +108 -0
- data/lib/sem4r/info/info_service.rb +11 -66
- data/lib/sem4r/{common/operation.rb → operation.rb} +3 -1
- data/lib/sem4r/report_definition/report_definition.rb +75 -15
- data/lib/sem4r/report_definition/report_definition_account_extension.rb +79 -0
- data/lib/sem4r/report_definition/report_definition_operation.rb +3 -1
- data/lib/sem4r/report_definition/report_definition_service.rb +7 -7
- data/lib/sem4r/report_definition/report_field.rb +57 -0
- data/lib/sem4r/sem4r_error.rb +1 -0
- data/lib/sem4r/services/http_connector.rb +93 -0
- data/lib/sem4r/services/service.rb +1 -1
- data/lib/sem4r/services/soap_call.rb +27 -5
- data/lib/sem4r/services/soap_connector.rb +2 -147
- data/lib/sem4r/services/soap_dumper.rb +105 -0
- data/lib/sem4r/services/soap_message_v13.rb +15 -9
- data/lib/sem4r/services/{soap_message_v2009.rb → soap_message_v2010.rb} +26 -12
- data/lib/sem4r/targeting_idea/targeting_idea.rb +16 -11
- data/lib/sem4r/targeting_idea/targeting_idea_account_extension.rb +52 -0
- data/lib/sem4r/targeting_idea/targeting_idea_selector.rb +36 -10
- data/lib/sem4r/targeting_idea/targeting_idea_service.rb +5 -5
- data/lib/sem4r/v13_account/account_account_extension.rb +103 -0
- data/lib/sem4r/v13_account/billing_address.rb +10 -21
- data/lib/sem4r/v13_report/report.rb +8 -8
- data/lib/sem4r/v13_report/report_account_extension.rb +63 -0
- data/lib/sem4r/v13_report/report_job.rb +1 -1
- data/lib/sem4r.rb +27 -6
- data/lib/sem4r_cli.rb +4 -6
- data/lib/{sem4r → soap_helpers}/soap_attributes.rb +105 -13
- data/sem4r.gemspec +229 -190
- data/spec/{aggregates_spec_helper.rb → aggregates_rspec_helper.rb} +0 -0
- data/spec/build_fixtures.rb +84 -0
- data/spec/rspec_hash.rb +66 -0
- data/spec/{spec_helper.rb → rspec_helper.rb} +4 -2
- data/spec/rspec_matchers.rb +102 -0
- data/spec/rspec_sem4r_helper.rb +88 -0
- data/spec/sem4r/account_spec.rb +3 -4
- data/spec/sem4r/ad_group/ad_group_bids_spec.rb +4 -3
- data/spec/sem4r/ad_group/ad_group_service_spec.rb +8 -7
- data/spec/sem4r/ad_group/ad_group_spec.rb +5 -4
- data/spec/{fixtures/services/ad_group → sem4r/ad_group/fixtures}/get-first-req.xml +0 -0
- data/spec/{fixtures/services/ad_group → sem4r/ad_group/fixtures}/get-first-res.xml +0 -0
- data/spec/{fixtures/services/ad_group → sem4r/ad_group/fixtures}/get-manual-cpm-bids-req.xml +0 -0
- data/spec/{fixtures/services/ad_group → sem4r/ad_group/fixtures}/get-manual-cpm-bids-res.xml +0 -0
- data/spec/{fixtures/services/ad_group → sem4r/ad_group/fixtures}/mutate_add-req.xml +0 -0
- data/spec/{fixtures/services/ad_group → sem4r/ad_group/fixtures}/mutate_add-res.xml +0 -0
- data/spec/sem4r/ad_group_ad/ad_group_ad_operation_spec.rb +3 -3
- data/spec/sem4r/ad_group_ad/ad_group_ad_service_spec.rb +6 -5
- data/spec/sem4r/ad_group_ad/ad_group_ad_spec.rb +6 -5
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/get_mobile_ad-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/get_mobile_ad-res.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/get_text_ad-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/get_text_ad-res.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/mutate_add_mobile_ad-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/mutate_add_mobile_ad-res.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/mutate_add_text_ad-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/mutate_add_text_ad-res.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/mutate_add_two_criterions-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_ad → sem4r/ad_group_ad/fixtures}/mutate_add_two_criterions-res.xml +0 -0
- data/spec/sem4r/ad_group_criterion/ad_group_criterion_bids_spec.rb +5 -4
- data/spec/sem4r/ad_group_criterion/ad_group_criterion_service_spec.rb +6 -5
- data/spec/sem4r/ad_group_criterion/ad_group_criterion_spec.rb +6 -5
- data/spec/sem4r/ad_group_criterion/criterion_spec.rb +5 -4
- data/spec/{fixtures/services/ad_group_criterion → sem4r/ad_group_criterion/fixtures}/get-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_criterion → sem4r/ad_group_criterion/fixtures}/get-res.xml +0 -0
- data/spec/{fixtures/services/ad_group_criterion → sem4r/ad_group_criterion/fixtures}/mutate_add_criterion_keyword-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_criterion → sem4r/ad_group_criterion/fixtures}/mutate_add_criterion_keyword-res.xml +0 -0
- data/spec/{fixtures/services/ad_group_criterion → sem4r/ad_group_criterion/fixtures}/mutate_add_criterion_placement-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_criterion → sem4r/ad_group_criterion/fixtures}/mutate_add_criterion_placement-res.xml +0 -0
- data/spec/{fixtures/services/ad_group_criterion → sem4r/ad_group_criterion/fixtures}/mutate_add_negative_keyword-req.xml +0 -0
- data/spec/{fixtures/services/ad_group_criterion → sem4r/ad_group_criterion/fixtures}/mutate_add_negative_keyword-res.xml +0 -0
- data/spec/sem4r/ad_param/ad_param_service_spec.rb +6 -5
- data/spec/sem4r/ad_param/ad_param_spec.rb +3 -2
- data/spec/{fixtures/services/ad_param → sem4r/ad_param/fixtures}/mutate_set-req.xml +0 -0
- data/spec/{fixtures/services/ad_param → sem4r/ad_param/fixtures}/mutate_set-res.xml +0 -0
- data/spec/sem4r/adwords_spec.rb +1 -1
- data/spec/sem4r/bulk_mutate_job/bulk_mutate_job_service_spec.rb +6 -5
- data/spec/sem4r/bulk_mutate_job/bulk_mutate_job_spec.rb +4 -3
- data/spec/{fixtures/services/bulk_mutate_job → sem4r/bulk_mutate_job/fixtures}/get-req.xml +0 -0
- data/spec/{fixtures/services/bulk_mutate_job → sem4r/bulk_mutate_job/fixtures}/get-res.xml +0 -0
- data/spec/{fixtures/services/bulk_mutate_job → sem4r/bulk_mutate_job/fixtures}/mutate-req.xml +0 -0
- data/spec/{fixtures/services/bulk_mutate_job → sem4r/bulk_mutate_job/fixtures}/mutate-res.xml +0 -0
- data/spec/sem4r/bulk_mutate_job/job_operation_spec.rb +3 -2
- data/spec/sem4r/campaign/campaign_service_spec.rb +8 -7
- data/spec/sem4r/campaign/campaign_spec.rb +3 -2
- data/spec/{fixtures/services/campaign → sem4r/campaign/fixtures}/get-req.xml +0 -0
- data/spec/{fixtures/services/campaign → sem4r/campaign/fixtures}/get-res.xml +0 -0
- data/spec/{fixtures/services/campaign → sem4r/campaign/fixtures}/mutate_add-req.xml +0 -0
- data/spec/{fixtures/services/campaign → sem4r/campaign/fixtures}/mutate_add-res.xml +0 -0
- data/spec/sem4r/cli/cli_spec.rb +2 -3
- data/spec/sem4r/credentials_spec.rb +1 -1
- data/spec/sem4r/info/account_info_extension_spec.rb +51 -0
- data/spec/sem4r/info/fixtures/get_unit_count-req.xml +34 -0
- data/spec/sem4r/info/fixtures/get_unit_count-res.xml +27 -0
- data/spec/sem4r/nokogiri_parsing_spec.rb +105 -0
- data/spec/{fixtures/services/report_definition → sem4r/report_definition/fixtures}/mutate_add-req.xml +0 -0
- data/spec/{fixtures/services/report_definition → sem4r/report_definition/fixtures}/mutate_add-req_orig.xml +0 -0
- data/spec/sem4r/report_definition/report_definition_service_spec.rb +5 -3
- data/spec/sem4r/report_definition/report_definition_spec.rb +6 -3
- data/spec/sem4r/rexml_parsing_spec.rb +22 -22
- data/spec/sem4r/services/service_spec.rb +2 -1
- data/spec/sem4r/services/soap_call_spec.rb +6 -5
- data/spec/sem4r/services/soap_message_v13_spec.rb +5 -11
- data/spec/{fixtures/services/targeting_idea → sem4r/targeting_idea/fixtures}/get-req-all-options.xml +0 -0
- data/spec/{fixtures/services/targeting_idea → sem4r/targeting_idea/fixtures}/get-req.xml +9 -11
- data/spec/sem4r/targeting_idea/fixtures/get-res.xml +2276 -0
- data/spec/sem4r/targeting_idea/targeting_idea_selector_spec.rb +30 -11
- data/spec/sem4r/targeting_idea/targeting_idea_service_spec.rb +4 -3
- data/spec/sem4r/targeting_idea/targeting_idea_spec.rb +5 -4
- data/spec/sem4r/v13_account/account_account_extension_spec.rb +47 -0
- data/spec/sem4r/v13_account/account_service_spec.rb +6 -5
- data/spec/sem4r/v13_account/billing_address_spec.rb +40 -0
- data/spec/{fixtures/services/v13_account → sem4r/v13_account/fixtures}/get_account_info-req.xml +0 -0
- data/spec/{fixtures/services/v13_account → sem4r/v13_account/fixtures}/get_account_info-res.xml +0 -0
- data/spec/{fixtures/services/v13_account → sem4r/v13_account/fixtures}/get_client_accounts-req.xml +0 -0
- data/spec/{fixtures/services/v13_account → sem4r/v13_account/fixtures}/get_client_accounts-res.xml +0 -0
- data/spec/{fixtures/services/v13_report → sem4r/v13_report/fixtures}/get_all_jobs-req.xml +0 -0
- data/spec/{fixtures/services/v13_report → sem4r/v13_report/fixtures}/get_all_jobs-res.xml +2 -2
- data/spec/{fixtures/services/v13_report → sem4r/v13_report/fixtures}/schedule_report_job-req.xml +0 -0
- data/spec/{fixtures/services/v13_report → sem4r/v13_report/fixtures}/schedule_report_job-res.xml +0 -0
- data/spec/sem4r/v13_report/report_service_spec.rb +13 -11
- data/spec/sem4r/v13_report/report_spec.rb +4 -3
- data/spec/sem4r_stubs.rb +182 -0
- data/spec/soap_helpers/soap_attributes_spec.rb +129 -0
- metadata +225 -125
- data/spec/fixtures/services/info/get_unit_count-req.xml +0 -30
- data/spec/fixtures/services/info/get_unit_count-res.xml +0 -29
- data/spec/fixtures/services/targeting_idea/get-res.xml +0 -3601
- data/spec/sem4r/soap_attributes_spec.rb +0 -116
- data/spec/sem4r_spec_helper.rb +0 -353
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: http://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
builder (3.0.0)
|
|
5
|
+
diff-lcs (1.1.2)
|
|
6
|
+
differ (0.1.1)
|
|
7
|
+
git (1.2.5)
|
|
8
|
+
jeweler (1.5.1)
|
|
9
|
+
bundler (~> 1.0.0)
|
|
10
|
+
git (>= 1.2.5)
|
|
11
|
+
rake
|
|
12
|
+
nokogiri (1.4.4)
|
|
13
|
+
nokogiri (1.4.4-java)
|
|
14
|
+
weakling (>= 0.0.3)
|
|
15
|
+
rake (0.8.7)
|
|
16
|
+
rspec (2.1.0)
|
|
17
|
+
rspec-core (~> 2.1.0)
|
|
18
|
+
rspec-expectations (~> 2.1.0)
|
|
19
|
+
rspec-mocks (~> 2.1.0)
|
|
20
|
+
rspec-core (2.1.0)
|
|
21
|
+
rspec-expectations (2.1.0)
|
|
22
|
+
diff-lcs (~> 1.1.2)
|
|
23
|
+
rspec-mocks (2.1.0)
|
|
24
|
+
weakling (0.0.4-java)
|
|
25
|
+
|
|
26
|
+
PLATFORMS
|
|
27
|
+
java
|
|
28
|
+
ruby
|
|
29
|
+
|
|
30
|
+
DEPENDENCIES
|
|
31
|
+
builder
|
|
32
|
+
differ
|
|
33
|
+
jeweler
|
|
34
|
+
nokogiri
|
|
35
|
+
rake
|
|
36
|
+
rspec
|
data/README.rdoc
CHANGED
|
@@ -44,10 +44,40 @@ Follow the sem4r.com[http://www.sem4r.com] feed for announcements of new release
|
|
|
44
44
|
|
|
45
45
|
sudo gem install sem4r
|
|
46
46
|
|
|
47
|
+
== Ruby Versions
|
|
48
|
+
|
|
49
|
+
Sem4r tested on following ruby version:
|
|
50
|
+
|
|
51
|
+
* 1.9.2-p0 - linux (works)
|
|
52
|
+
* jruby 1.5.5 - linux (some example are not working, certificate verify failed OpenSSL in sandbox)
|
|
53
|
+
* ...
|
|
54
|
+
|
|
55
|
+
== How to submit a bug report
|
|
56
|
+
|
|
57
|
+
== Contribute
|
|
58
|
+
|
|
59
|
+
So you want your prefered service supported by sem4r. Great! Please follow this steps:
|
|
60
|
+
|
|
61
|
+
* Fork the project
|
|
62
|
+
* Clone down your fork
|
|
63
|
+
* Create a topic branch to contain your change ( git checkout -b my_awesome_feature )
|
|
64
|
+
* Hack away, add tests. Not necessarily in that order.
|
|
65
|
+
* Make sure rspec tests passes by running rake
|
|
66
|
+
* Add an example of use of the new feature or service.
|
|
67
|
+
* Make sure all examples run without errors. This will take some time. ( rake sem4r:examples )
|
|
68
|
+
* If necessary, rebase your commits.
|
|
69
|
+
* Push the branch up ( git push origin my_awesome_feature )
|
|
70
|
+
* Send a pull request
|
|
71
|
+
|
|
47
72
|
== Contributors
|
|
48
73
|
|
|
74
|
+
If I miss someone send me a note.
|
|
75
|
+
|
|
49
76
|
* Glenn Gillen {http://github.com/rubypond}
|
|
50
77
|
|
|
78
|
+
|
|
79
|
+
To see all contributors execute: git shortlog -n -s --no-merges
|
|
80
|
+
|
|
51
81
|
== License
|
|
52
82
|
|
|
53
83
|
(The MIT License)
|
data/Rakefile
CHANGED
|
@@ -32,13 +32,14 @@ begin
|
|
|
32
32
|
#
|
|
33
33
|
# gem.add_dependency 'patron'
|
|
34
34
|
gem.add_dependency 'builder'
|
|
35
|
+
gem.add_dependency 'nokogiri'
|
|
35
36
|
gem.add_development_dependency 'rspec'
|
|
36
37
|
gem.add_development_dependency 'differ'
|
|
37
38
|
|
|
38
39
|
#
|
|
39
40
|
# files
|
|
40
41
|
#
|
|
41
|
-
gem.files = %w{LICENSE README.rdoc Rakefile VERSION.yml sem4r.gemspec}
|
|
42
|
+
gem.files = %w{LICENSE README.rdoc Rakefile VERSION.yml sem4r.gemspec Gemfile Gemfile.lock}
|
|
42
43
|
gem.files << 'config/sem4r.example.yml'
|
|
43
44
|
gem.files.concat Dir['examples_sem4r/*.rb']
|
|
44
45
|
gem.files.concat Dir['examples_blog/*.rb']
|
|
@@ -48,6 +49,7 @@ begin
|
|
|
48
49
|
# test files
|
|
49
50
|
#
|
|
50
51
|
gem.test_files = Dir['spec/**/*.rb']
|
|
52
|
+
gem.test_files.concat Dir['spec/**/*.xml']
|
|
51
53
|
gem.test_files.concat Dir['spec/fixtures/**/*']
|
|
52
54
|
|
|
53
55
|
#
|
|
@@ -82,18 +84,19 @@ end
|
|
|
82
84
|
# spec
|
|
83
85
|
#
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
require 'rspec/core/rake_task'
|
|
88
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
89
|
+
|
|
90
|
+
RSpec::Core::RakeTask.new do |t|
|
|
91
|
+
t.rspec_opts = ["--color", "--format", "spec", '--backtrace']
|
|
92
|
+
t.pattern = 'spec/**/*_spec.rb'
|
|
93
|
+
end
|
|
94
|
+
|
|
92
95
|
#desc "Generate HTML report for failing examples"
|
|
93
|
-
#
|
|
94
|
-
#
|
|
95
|
-
#
|
|
96
|
-
#
|
|
96
|
+
#RSpec::Core::RakeTask.new('failing_examples_with_html') do |spec|
|
|
97
|
+
# spec.pattern = 'failing_examples/**/*.rb'
|
|
98
|
+
# spec.rspec_opts = ["--format", "html:doc/reports/tools/failing_examples.html", "--diff"]
|
|
99
|
+
# spec.fail_on_error = false
|
|
97
100
|
#end
|
|
98
101
|
|
|
99
102
|
task :test => :check_dependencies
|
data/VERSION.yml
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
account = adwords.account
|
|
@@ -21,11 +21,15 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
adwords.account.p_info
|
|
28
|
-
|
|
28
|
+
adwords.account.client_accounts.each do |c|
|
|
29
|
+
c.p_info
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
(InfoSelector::UsageTypes - [InfoSelector::METHOD_COST]).each do |usage_type|
|
|
29
33
|
n = adwords.account.year_unit_cost(usage_type)
|
|
30
34
|
puts "#{usage_type} -> #{n}"
|
|
31
35
|
end
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
puts "List AdGroup Advertising"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
puts "List AdGroup Keywords"
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
require File.dirname(__FILE__) + "/example_helper"
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
26
25
|
|
|
27
26
|
run_example(__FILE__) do |adwords|
|
|
28
27
|
account = adwords.account
|
|
@@ -21,20 +21,35 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
require File.dirname(__FILE__) + "/example_helper"
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
26
25
|
|
|
27
26
|
run_example(__FILE__) do |adwords|
|
|
28
27
|
|
|
29
28
|
account = adwords.account
|
|
30
29
|
|
|
31
|
-
# account.
|
|
30
|
+
# account.report_fields
|
|
31
|
+
|
|
32
32
|
|
|
33
33
|
rd = account.report_definition do
|
|
34
|
-
name
|
|
34
|
+
name "Keywords performance report #1290336379254"
|
|
35
|
+
type "KEYWORDS_PERFORMANCE_REPORT"
|
|
36
|
+
date_range "CUSTOM_DATE"
|
|
37
|
+
from "20100101"
|
|
38
|
+
to "20100110"
|
|
39
|
+
format "CSV"
|
|
40
|
+
|
|
41
|
+
field "AdGroupId"
|
|
42
|
+
field "Id"
|
|
43
|
+
field "KeywordText"
|
|
44
|
+
field "KeywordMatchType"
|
|
45
|
+
field "Impressions"
|
|
46
|
+
field "Clicks"
|
|
47
|
+
field "Cost"
|
|
35
48
|
end
|
|
36
49
|
rd.save
|
|
50
|
+
puts rd.id
|
|
37
51
|
|
|
38
52
|
puts rd.to_s
|
|
39
53
|
|
|
54
|
+
account.p_report_definitions
|
|
40
55
|
end
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
puts "Create an adgroup with adparam"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
#
|
|
23
23
|
# -------------------------------------------------------------------------
|
|
24
24
|
|
|
25
|
-
require File.dirname(__FILE__)
|
|
25
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
26
26
|
|
|
27
27
|
run_example(__FILE__) do |adwords|
|
|
28
28
|
account = adwords.account
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
adwords.account.geo_location
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def create_bulk_mutate_job(campaign, adgroup)
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
account = adwords.account
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
require File.dirname(__FILE__)
|
|
24
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
25
25
|
|
|
26
26
|
run_example(__FILE__) do |adwords|
|
|
27
27
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
# -------------------------------------------------------------------
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
require File.dirname(__FILE__)
|
|
25
|
+
require File.expand_path( File.join( File.dirname(__FILE__), "example_helper") )
|
|
26
26
|
|
|
27
27
|
run_example(__FILE__) do |adwords|
|
|
28
28
|
|
|
@@ -23,13 +23,9 @@
|
|
|
23
23
|
|
|
24
24
|
require 'rubygems'
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
cwd = File.expand_path( File.join( File.dirname(__FILE__), "..", "lib" ) )
|
|
30
|
-
$:.unshift(cwd) unless $:.include?(cwd)
|
|
31
|
-
require 'sem4r'
|
|
32
|
-
end
|
|
26
|
+
cwd = File.expand_path( File.join( File.dirname(__FILE__), "..", "lib" ) )
|
|
27
|
+
$:.unshift(cwd) unless $:.include?(cwd)
|
|
28
|
+
require 'sem4r'
|
|
33
29
|
include Sem4r
|
|
34
30
|
|
|
35
31
|
def tmp_dirname
|
|
@@ -94,8 +90,8 @@ def run_example(file)
|
|
|
94
90
|
|
|
95
91
|
adwords = Adwords.sandbox # search credentials into ~/.sem4r file
|
|
96
92
|
adwords.dump_soap_options( example_soap_dump_options(file) )
|
|
97
|
-
adwords.logger = Logger.new(STDOUT)
|
|
98
|
-
|
|
93
|
+
# adwords.logger = Logger.new(STDOUT)
|
|
94
|
+
adwords.logger = example_logger(file)
|
|
99
95
|
|
|
100
96
|
#
|
|
101
97
|
# example body
|
|
@@ -112,4 +108,3 @@ def run_example(file)
|
|
|
112
108
|
puts "---------------------------------------------------------------------"
|
|
113
109
|
|
|
114
110
|
end
|
|
115
|
-
|