serpscan 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/serpscan/keyword.rb +4 -0
- data/lib/serpscan/version.rb +1 -1
- data/spec/lib/serpscan/keyword_spec.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 412ac7c48836fef8fea3d7e290dead4210469d71
|
4
|
+
data.tar.gz: 7e242920660cbe89d0c75dd230070683129e0dfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbd2c2a7c46b2b3483b198bbc80a819c259e01998ea11c45d0b53f977382a9e5639677e61cf03a4f45af6df496a60dac5432ffa7877af6c57cca5e7da34ec17d
|
7
|
+
data.tar.gz: e512e1db694a02f04ff4bcc9f6d7aa1288e01f515159746ad5f8c6f660941834563ac61e65205d2f6c30bd6e8d9f822dc2ed6617166b6bb3b46a3078eb5c4656
|
data/README.md
CHANGED
@@ -28,6 +28,12 @@ Set your API key. If you're using Rails you may want to place the code below in
|
|
28
28
|
Serpscan.api_key = 'YOUR API KEY'
|
29
29
|
```
|
30
30
|
|
31
|
+
Alternatively you can set your API key as an environment variable:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
ENV['SERPSCAN_API_KEY'] = 'YOUR API KEY'
|
35
|
+
```
|
36
|
+
### Websites
|
31
37
|
To create a website:
|
32
38
|
|
33
39
|
```ruby
|
@@ -54,6 +60,7 @@ website = Serpscan::Website.find(1)
|
|
54
60
|
website.keywords
|
55
61
|
```
|
56
62
|
|
63
|
+
### Keywords
|
57
64
|
To create a keyword:
|
58
65
|
|
59
66
|
```ruby
|
@@ -61,6 +68,15 @@ website = Serpscan::Website.find(1)
|
|
61
68
|
website.create_keyword('example keyword')
|
62
69
|
```
|
63
70
|
|
71
|
+
To get a particular keyword:
|
72
|
+
```ruby
|
73
|
+
Serpscan::Keyword.find(id)
|
74
|
+
```
|
75
|
+
|
76
|
+
Ranking history:
|
77
|
+
```ruby
|
78
|
+
Serpscan::Keyword.find(id).history #> [['2015-01-01', 2], ['2015-01-02', 1]]
|
79
|
+
```
|
64
80
|
## Attributes
|
65
81
|
|
66
82
|
Each of these attributes can be called directly on the object. Example:
|
data/lib/serpscan/keyword.rb
CHANGED
data/lib/serpscan/version.rb
CHANGED
@@ -2,7 +2,18 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Serpscan::Keyword, vcr: true do
|
4
4
|
it_should_behave_like 'a creatable object', keyword: 'example keyword', website_id: 1, search_engine_country_id: 1
|
5
|
-
|
6
5
|
it_should_behave_like 'a findable object', 1, Serpscan::Keyword::ATTRIBUTES
|
7
6
|
it_should_behave_like 'a deletable object', 2
|
7
|
+
|
8
|
+
describe 'history' do
|
9
|
+
it 'should return an array of dates and rankings' do
|
10
|
+
keyword = subject.class.find(1)
|
11
|
+
history = keyword.history
|
12
|
+
|
13
|
+
expect(history.class).to eq Array
|
14
|
+
expect(history.first.class).to eq Array
|
15
|
+
expect(history.first[0].class).to eq String
|
16
|
+
expect(history.first[1].class).to eq Fixnum
|
17
|
+
end
|
18
|
+
end
|
8
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serpscan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Montgomery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|