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 +4 -4
- data/.gitignore +1 -1
- data/Gemfile.lock +1 -1
- data/README.markdown +45 -7
- data/credentials.yml.example +11 -0
- data/lib/generators/majestic/api/install_generator.rb +22 -0
- data/lib/generators/majestic/api/templates/config.rb +5 -0
- data/lib/majestic/api/version.rb +1 -1
- metadata +4 -2
- data/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef0b400e5ecfc161a111c7459ef16bdccf346eb9f2cea4070474a0413175f59
|
4
|
+
data.tar.gz: '0706385753f7434ef16d2a1eb4b39c0210c5db8418bead7b612f9391be12e18f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 877c69ddd75203342287776d082309ae63c4fee64c74b377357a93cd5e813c7cbab6b55f5f8b90c6768d92296e37264051304b15af770d426f9e212ff9eeb083
|
7
|
+
data.tar.gz: '01833611f7a17857118d00a7120d66693abd8ca4c596f77e5a1a945f83ce97a9b5f606b940f76df5f0e8d53b8adbc2bbe6c952cf16d350c78d3d39f2f012b412'
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
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.
|
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
|
-
|
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,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
|
data/lib/majestic/api/version.rb
CHANGED
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.
|
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
|