Module: Semrush
- Defined in:
- lib/semrush.rb,
lib/semrush/report.rb,
lib/semrush/version.rb,
lib/semrush/exception.rb,
lib/semrush/exception/bad_query.rb,
lib/semrush/exception/bad_api_key.rb,
lib/semrush/exception/bad_argument.rb,
lib/semrush/exception/nothing_found.rb,
lib/semrush/exception/unknown_error.rb,
lib/semrush/exception/api_access_disabled.rb,
lib/semrush/exception/api_report_type_disabled.rb,
lib/semrush/exception/api_units_balance_is_zero.rb
Defined Under Namespace
Modules: Exception Classes: Report
Constant Summary collapse
- 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%"- API_UNITS_URL =
"http://www.semrush.com/users/countapiunits.html?key=%API_KEY%"- VERSION =
we want to follow the API version: for API 3.0, the gem will be version 3.0.x
"3.0.16"- @@api_key =
""- @@debug =
false- @@before =
Proc.new{}
- @@after =
Proc.new{}
- @@email_options =
{}
- @@seconds_between_mails =
600- @@too_many_queries =
{:subject => 'SemRush API: too many queries for the day', :body => 'You made too many requests for today. You should upgrade your plan in order to be able to send more requests to SemRush.'}
Class Method Summary collapse
Class Method Details
.config {|_self| ... } ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/semrush.rb', line 37 def self.config yield self Pony. = raise Exception::BadApiKey.new if @@api_key.nil? || @@api_key.empty? raise Exception::BadArgument.new(self, "before is not a proc: proc type is required.") unless @@before.is_a?(Proc) raise Exception::BadArgument.new(self, "after is not a proc: proc type is required.") unless @@after.is_a?(Proc) end |