majestic-api 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e1e35e83bb4074c2fea067e5049b0b7407ae08237b8d85ace5a76b081243fa9
4
- data.tar.gz: afaf42abf89b9efbd9f79acfaea72ac20d26d0375843ab044f7a2d1a151ae69a
3
+ metadata.gz: bef0b400e5ecfc161a111c7459ef16bdccf346eb9f2cea4070474a0413175f59
4
+ data.tar.gz: '0706385753f7434ef16d2a1eb4b39c0210c5db8418bead7b612f9391be12e18f'
5
5
  SHA512:
6
- metadata.gz: c6e2531fcae909e043e635e2ff75b40f992bcbf42ce18a5a19a9c12f61ce9cbabab6a659ef2c7ba9ffab05c73e6011fc49743fd8e92140a6a1db3d61a4300293
7
- data.tar.gz: 25f597ae88854e0ce91cf2c5490ab9d8079aca5b1bdb6d6220f2371f1beea291f8e1fa77beeeb008f0bf8fa87c82eb8988e56434263e1a0a7f45cdc8e7fed586
6
+ metadata.gz: 877c69ddd75203342287776d082309ae63c4fee64c74b377357a93cd5e813c7cbab6b55f5f8b90c6768d92296e37264051304b15af770d426f9e212ff9eeb083
7
+ data.tar.gz: '01833611f7a17857118d00a7120d66693abd8ca4c596f77e5a1a945f83ce97a9b5f606b940f76df5f0e8d53b8adbc2bbe6c952cf16d350c78d3d39f2f012b412'
data/.gitignore CHANGED
@@ -17,4 +17,4 @@
17
17
 
18
18
  credentials.yml
19
19
  .ruby-version
20
- .ruby-gemset
20
+ .ruby-gemset.DS_Store
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- majestic-api (1.4.0)
4
+ majestic-api (1.4.1)
5
5
  faraday (>= 0.15.4)
6
6
  faraday_middleware (>= 0.13.1)
7
7
 
data/README.markdown CHANGED
@@ -1,4 +1,4 @@
1
- # Majestic Ruby API Client #
1
+ # Majestic Ruby API Client
2
2
 
3
3
  Client intended to be used with [Majestic's API](http://developer-support.majesticseo.com/).
4
4
 
@@ -6,20 +6,58 @@ This gem is forked/rewritten based on [https://github.com/SebastianJ/Majestic-SE
6
6
 
7
7
  Majestic dropped the "SEO" brand a long time ago and the previous client's name was out of sync with this change.
8
8
 
9
- The client has also been slightly rewritten and prepared to be easier to maintain.
9
+ The client has also been slightly rewritten and has been prepared to be easier to maintain.
10
10
 
11
- ## Installation ##
11
+ ## Installation
12
12
  ```
13
13
  gem install majestic-api
14
14
  ```
15
15
 
16
- ## Configuration ##
16
+ ## Configuration
17
17
  ```
18
18
  Majestic::Api.configure do |config|
19
- config.environment = :production # The environment to use, valid values: :sandbox, :production
20
19
  config.api_key = 'api_key' # Your API key provided by Majestic
21
- config.verbose = false # Set to true to enable Faraday's logging middleware to get more information
20
+ config.environment = :production # The environment to use, valid values: :sandbox, :production
21
+ config.verbose = false # Set to true to enable logging + Faraday's logging middleware to get more information
22
22
  end
23
23
  ```
24
24
 
25
- If you're using Rails, create an initializer in config/initializers/majestic.rb to configure the client globally in your app.
25
+ To generate an initializer execute the following command:
26
+
27
+ ```ruby
28
+ rails g majestic:api:install Majestic
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ```ruby
34
+ client = ::Majestic::Api::Client.new
35
+ data = client.get_index_item_info(urls: ["google.com", "yahoo.com"], params: {data_source: :historic})
36
+ data.items&.each { |item| puts "Historic Trust Flow for domain '#{item.url}' is: #{item.trust_flow}"}
37
+ ```
38
+
39
+ ## Development
40
+
41
+ After checking out the repo, run `bin/setup` to install dependencies.
42
+
43
+ Copy credentials.yml.example to credentials.yml and enter your API key in that file.
44
+
45
+ Run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
46
+
47
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
48
+
49
+ ## Testing
50
+
51
+ Please be aware that removing any of the VCR cassettes under spec/fixtures/vcr_cassettes and re-running the specs might lead to sensitive/personal data being stored in the newly generated cassettes!
52
+
53
+ ## Contributing
54
+
55
+ Bug reports and pull requests are welcome on GitHub at https://github.com/SebastianJ/majestic-api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
56
+
57
+ ## License
58
+
59
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
60
+
61
+ ## Code of Conduct
62
+
63
+ Everyone interacting in the Adtraction::Api project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/SebastianJ/majestic-api/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,11 @@
1
+ development:
2
+ environment: production
3
+ api_key: "YOUR_API_KEY"
4
+
5
+ test:
6
+ environment: production
7
+ api_key: "YOUR_API_KEY"
8
+
9
+ production:
10
+ environment: production
11
+ api_key: "YOUR_API_KEY"
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators/base"
4
+
5
+ module Majestic
6
+ module Api
7
+ module Generators
8
+ class InstallGenerator < Rails::Generators::NamedBase
9
+ include Rails::Generators::ResourceHelpers
10
+
11
+ source_root File.expand_path('templates', __dir__)
12
+
13
+ desc "Creates an initializer for Majestic::Api for your Rails application."
14
+
15
+ def copy_initializer_file
16
+ copy_file "config.rb", "config/initializers/majestic_api.rb"
17
+ end
18
+
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ Majestic::Api.configure do |config|
2
+ config.api_key = "ENTER_YOUR_API_KEY_HERE"
3
+ config.environment = :production
4
+ config.verbose = false
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Majestic
2
2
  module Api
3
- VERSION = "1.4.0"
3
+ VERSION = "1.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: majestic-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Johnsson
@@ -143,7 +143,6 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - ".DS_Store"
147
146
  - ".gitignore"
148
147
  - CODE_OF_CONDUCT.md
149
148
  - Gemfile
@@ -153,6 +152,9 @@ files:
153
152
  - Rakefile
154
153
  - bin/console
155
154
  - bin/setup
155
+ - credentials.yml.example
156
+ - lib/generators/majestic/api/install_generator.rb
157
+ - lib/generators/majestic/api/templates/config.rb
156
158
  - lib/majestic/api.rb
157
159
  - lib/majestic/api/client.rb
158
160
  - lib/majestic/api/configuration.rb
data/.DS_Store DELETED
Binary file