semrush 3.0.15 → 3.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bc9e913c7a6a7d6e74a93d8ee7989c597219762f
4
+ data.tar.gz: d6a6f3225cf4ac4249c44946fe81f3ae64e4a2c8
5
+ SHA512:
6
+ metadata.gz: 42c30663c5e278bb5e1cdfccd1ed8443ec1b00b9e609eaac1e4d90c6bd7a1a7b00d9ef3387f89c47b6cafcf284d65ba4b5a00a981b73690d36e009f90a30e8f4
7
+ data.tar.gz: 9546b93e5e95d5602f713534103da12743fbf86a800a0a6831cb7064384956138ff59f4fd73047a3c347b438230aa75f452e0d8ce763be46485723c6bc79fc86
data/README.rdoc CHANGED
@@ -93,11 +93,18 @@ You may call for one of the following report types:
93
93
  data = report.competitors_organic_by_adwords # for a domain
94
94
  data = report.competitors_adwords_by_organic # for a domain
95
95
  data = report.related # keywords related report for a phrase
96
+ data = report.fullsearch # phrase fullsearch report
97
+ data = report.history_adwords # ads history for either a domain or a phrase
96
98
 
97
99
  For more information about the report types, please read http://www.semrush.com/api.html
98
100
 
99
101
  == ChangeLog
100
102
 
103
+ === 3.0.16, 2014-07-21
104
+
105
+ * Add support for fullsearch reports
106
+ * Add support for Adwords history reports
107
+
101
108
  === 3.0.15, 2013-06-26
102
109
 
103
110
  * activesupport dependency to >= 3.2.0 to support rails 4
data/lib/semrush.rb CHANGED
@@ -9,7 +9,7 @@ require 'semrush/exception'
9
9
  require 'semrush/report'
10
10
 
11
11
  module Semrush
12
- API_REPORT_URL = "http://%DB%.api.semrush.com/?action=report&type=%REPORT_TYPE%&%REQUEST_TYPE%=%REQUEST%&key=%API_KEY%&display_limit=%LIMIT%&display_offset=%OFFSET%&export=api&export_columns=%EXPORT_COLUMNS%&display_sort=%DISPLAY_SORT%&display_filter=%DISPLAY_FILTER%"
12
+ API_REPORT_URL = "http://api.semrush.com/?type=%REPORT_TYPE%&%REQUEST_TYPE%=%REQUEST%&key=%API_KEY%&display_limit=%LIMIT%&display_offset=%OFFSET%&export=api&database=%DB%&export_columns=%EXPORT_COLUMNS%&display_sort=%DISPLAY_SORT%&display_filter=%DISPLAY_FILTER%"
13
13
  API_UNITS_URL = "http://www.semrush.com/users/countapiunits.html?key=%API_KEY%"
14
14
  mattr_accessor :api_key
15
15
  @@api_key = ""
@@ -8,8 +8,8 @@ module Semrush
8
8
  # * :export_columns (ex: :export_columns => "Dn,Rk")
9
9
  class Report
10
10
  DBS = [:us, :uk, :ru, :de, :fr, :es, :it, :br, :au] #"us" - for Google.com, "uk" - for Google.co.uk, "ru" - for Google.ru, "de" for Google.de, "fr" for Google.fr, "es" for Google.es, "it" for Google.it Beta, "br" for Google.com.br Beta, "au" for Google.com.au Beta.
11
- REPORT_TYPES = [:domain_rank, :domain_organic, :domain_adwords, :domain_organic_organic, :domain_adwords_adwords, :domain_organic_adwords, :domain_adwords_organic,
12
- :phrase_this, :phrase_organic, :phrase_related,
11
+ REPORT_TYPES = [:domain_rank, :domain_organic, :domain_adwords, :domain_organic_organic, :domain_adwords_adwords, :domain_organic_adwords, :domain_adwords_organic, :domain_adwords_historical,
12
+ :phrase_this, :phrase_organic, :phrase_related, :phrase_adwords_historical, :phrase_fullsearch,
13
13
  :url_organic, :url_adwords]
14
14
  REQUEST_TYPES = [:domain, :phrase, :url]
15
15
 
@@ -18,7 +18,8 @@ module Semrush
18
18
  # Allows calls like:
19
19
  # * Semrush::Report.new.domain_rank(:request_type => :domain, :request => 'thedomain.com')
20
20
  # * Semrush::Report.new.domain_organic_organic(:request_type => :domain, :request => 'thedomain.com')
21
- # * Semrush::Report.new.phrase_related(:request_type => :phrase, :request => 'the phrase')
21
+ # * Semrush::Report.new.phrase_related(:request_type => :phrase, :request => 'the+phrase')
22
+ # * Semrush::Report.new.phrase_fullsearch(:request_type => :phrase, :request => 'the+phrase')
22
23
  def method_missing(method, *args)
23
24
  return super unless REPORT_TYPES.include?(method) && args.first.is_a?(Hash)
24
25
  request args.first.merge(:report_type => method)
@@ -110,7 +111,7 @@ module Semrush
110
111
  def basics params = {}
111
112
  domain? ? request(params.merge(:report_type => :domain_rank)) : request(params.merge(:report_type => :phrase_this))
112
113
  end
113
-
114
+
114
115
  # Organic report
115
116
  # Can be called for a domain or a URL.
116
117
  # Default columns for a domain:
@@ -139,7 +140,7 @@ module Semrush
139
140
  # * Dn - A site name
140
141
  # * Ur - Target URL
141
142
  def organic params = {}
142
- case
143
+ case
143
144
  when url? then request(params.merge(:report_type => :url_organic))
144
145
  when phrase? then request(params.merge(:report_type => :phrase_organic))
145
146
  else request(params.merge(:report_type => :domain_organic))
@@ -231,6 +232,12 @@ module Semrush
231
232
  request(params.merge(:report_type => :domain_adwords_organic))
232
233
  end
233
234
 
235
+ # Ads history for domain or phrase
236
+ # Default columns:
237
+ def history_adwords params = {}
238
+ domain? ? request(params.merge(:report_type => :domain_adwords_historical)) : request(params.merge(:report_type => :phrase_adwords_historical))
239
+ end
240
+
234
241
  # Related keyword report
235
242
  # Default columns:
236
243
  # * Ph - The search query which the site has within the first 20 Google search results
@@ -243,6 +250,18 @@ module Semrush
243
250
  request(params.merge(:report_type => :phrase_related))
244
251
  end
245
252
 
253
+ # Fullsearch keyword report
254
+ # Default columns:
255
+ # * Ph - The search query which the site has within the first 20 Google search results
256
+ # * Nq - Average number of queries of this keyword in a month, for the corresponding local version of Google
257
+ # * Cp - Average price of a click on the AdWords ad for this search query, in U.S. dollars
258
+ # * Co - Competition of advertisers in AdWords for that term, the higher is the number - the higher is the competition
259
+ # * Nr - The number of search results - how many pages does Google know for this query
260
+ # * Td - Dynamics of change in the number of search queries in the past 12 months (estimated)
261
+ def fullsearch params = {}
262
+ request(params.merge(:report_type => :phrase_fullsearch))
263
+ end
264
+
246
265
  private
247
266
 
248
267
  def request params = {}
@@ -278,8 +297,8 @@ module Semrush
278
297
  # * limit - number of results returned
279
298
  # * offset - says to skip that many results before beginning to return results to you
280
299
  # * export_columns - list of column names, separated by coma. You may list just the column names you need in an order you need.
281
- # * display_sort - a sorting as a String eg: 'am_asc' or 'am_desc'(read http://www.semrush.com/api)
282
- # * display_filter - list of filters separated by "|" (maximum number - 25). A filter consists of <sign>|<field>|<operation>|<value> (read http://www.semrush.com/api)
300
+ # * display_sort - a sorting as a String eg: 'am_asc' or 'am_desc'(read http://www.semrush.com/api)
301
+ # * display_filter - list of filters separated by "|" (maximum number - 25). A filter consists of <sign>|<field>|<operation>|<value> (read http://www.semrush.com/api)
283
302
  #
284
303
  # more details in http://www.semrush.com/api.html
285
304
  def validate_parameters params = {}
@@ -354,4 +373,4 @@ module Semrush
354
373
 
355
374
 
356
375
  end
357
- end
376
+ end
@@ -1,3 +1,3 @@
1
1
  module Semrush
2
- VERSION = "3.0.15" # we want to follow the API version: for API 3.0, the gem will be version 3.0.x
2
+ VERSION = "3.0.16" # we want to follow the API version: for API 3.0, the gem will be version 3.0.x
3
3
  end
metadata CHANGED
@@ -1,87 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semrush
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.15
5
- prerelease:
4
+ version: 3.0.16
6
5
  platform: ruby
7
6
  authors:
8
7
  - arambert
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-26 00:00:00.000000000 Z
11
+ date: 2014-07-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.2.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.2.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: pony
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.0.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: 1.0.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: 2.0.0
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: 2.0.0
78
69
  description: This gem is a ruby client for the SemRush API.
79
70
  email:
80
- - arambert@weboglobin.com
71
+ - adrien@rambert.me
81
72
  executables: []
82
73
  extensions: []
83
74
  extra_rdoc_files: []
84
75
  files:
76
+ - MIT-LICENSE
77
+ - README.rdoc
78
+ - Rakefile
79
+ - lib/semrush.rb
80
+ - lib/semrush/exception.rb
85
81
  - lib/semrush/exception/api_access_disabled.rb
86
82
  - lib/semrush/exception/api_report_type_disabled.rb
87
83
  - lib/semrush/exception/api_units_balance_is_zero.rb
@@ -90,36 +86,30 @@ files:
90
86
  - lib/semrush/exception/bad_query.rb
91
87
  - lib/semrush/exception/nothing_found.rb
92
88
  - lib/semrush/exception/unknown_error.rb
93
- - lib/semrush/exception.rb
94
89
  - lib/semrush/report.rb
95
90
  - lib/semrush/version.rb
96
- - lib/semrush.rb
97
91
  - lib/tasks/semrush_tasks.rake
98
- - MIT-LICENSE
99
- - Rakefile
100
- - README.rdoc
101
- homepage: http://www.weboglobin.com
92
+ homepage: http://adrienrambert.com
102
93
  licenses: []
94
+ metadata: {}
103
95
  post_install_message:
104
96
  rdoc_options: []
105
97
  require_paths:
106
98
  - lib
107
99
  required_ruby_version: !ruby/object:Gem::Requirement
108
- none: false
109
100
  requirements:
110
- - - ! '>='
101
+ - - ">="
111
102
  - !ruby/object:Gem::Version
112
103
  version: '0'
113
104
  required_rubygems_version: !ruby/object:Gem::Requirement
114
- none: false
115
105
  requirements:
116
- - - ! '>='
106
+ - - ">="
117
107
  - !ruby/object:Gem::Version
118
108
  version: '0'
119
109
  requirements: []
120
110
  rubyforge_project:
121
- rubygems_version: 1.8.24
111
+ rubygems_version: 2.2.1
122
112
  signing_key:
123
- specification_version: 3
113
+ specification_version: 4
124
114
  summary: This gem is a ruby client for the SemRush API.
125
115
  test_files: []