scribe_api 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -2
- data/Gemfile.lock +8 -4
- data/VERSION +1 -1
- data/scribe_api.gemspec +12 -9
- data/test/fixtures/vcr_cassettes/content_analysis.yml +73 -0
- data/test/fixtures/vcr_cassettes/kw_details.yml +37 -0
- data/test/fixtures/vcr_cassettes/kw_suggestions.yml +40 -0
- data/test/fixtures/vcr_cassettes/user_info.yml +36 -0
- data/test/helper.rb +13 -3
- data/test/test_scribe_api.rb +44 -20
- metadata +31 -28
- data/test/fixtures.json +0 -14
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
addressable (2.2.8)
|
4
5
|
archive-tar-minitar (0.5.2)
|
5
6
|
columnize (0.3.6)
|
6
|
-
|
7
|
+
crack (0.1.8)
|
7
8
|
git (1.2.5)
|
8
9
|
httparty (0.8.3)
|
9
10
|
multi_json (~> 1.0)
|
@@ -13,7 +14,6 @@ GEM
|
|
13
14
|
git (>= 1.2.5)
|
14
15
|
rake
|
15
16
|
rdoc
|
16
|
-
jnunemaker-matchy (0.4.0)
|
17
17
|
json (1.7.1)
|
18
18
|
linecache19 (0.5.12)
|
19
19
|
ruby_core_source (>= 0.1.4)
|
@@ -37,17 +37,21 @@ GEM
|
|
37
37
|
shoulda-matchers (~> 1.0.0)
|
38
38
|
shoulda-context (1.0.0)
|
39
39
|
shoulda-matchers (1.0.0)
|
40
|
+
vcr (2.2.0)
|
41
|
+
webmock (1.8.7)
|
42
|
+
addressable (>= 2.2.7)
|
43
|
+
crack (>= 0.1.7)
|
40
44
|
|
41
45
|
PLATFORMS
|
42
46
|
ruby
|
43
47
|
|
44
48
|
DEPENDENCIES
|
45
49
|
bundler (~> 1.0.0)
|
46
|
-
fakeweb (= 1.3.0)
|
47
50
|
httparty
|
48
51
|
jeweler (~> 1.8.3)
|
49
|
-
jnunemaker-matchy (= 0.4.0)
|
50
52
|
json
|
51
53
|
rdoc (~> 3.12)
|
52
54
|
ruby-debug19
|
53
55
|
shoulda
|
56
|
+
vcr
|
57
|
+
webmock
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/scribe_api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{scribe_api}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Ian Henry Smith}]
|
12
|
-
s.date = %q{2012-
|
12
|
+
s.date = %q{2012-06-01}
|
13
13
|
s.description = %q{easily access the scribe api.}
|
14
14
|
s.email = %q{ianhenrysmith@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -26,7 +26,10 @@ Gem::Specification.new do |s|
|
|
26
26
|
"VERSION",
|
27
27
|
"lib/scribe_api.rb",
|
28
28
|
"scribe_api.gemspec",
|
29
|
-
"test/fixtures.
|
29
|
+
"test/fixtures/vcr_cassettes/content_analysis.yml",
|
30
|
+
"test/fixtures/vcr_cassettes/kw_details.yml",
|
31
|
+
"test/fixtures/vcr_cassettes/kw_suggestions.yml",
|
32
|
+
"test/fixtures/vcr_cassettes/user_info.yml",
|
30
33
|
"test/helper.rb",
|
31
34
|
"test/test_scribe_api.rb"
|
32
35
|
]
|
@@ -47,8 +50,8 @@ Gem::Specification.new do |s|
|
|
47
50
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
48
51
|
s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
|
49
52
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
50
|
-
s.add_development_dependency(%q<
|
51
|
-
s.add_development_dependency(%q<
|
53
|
+
s.add_development_dependency(%q<vcr>, [">= 0"])
|
54
|
+
s.add_development_dependency(%q<webmock>, [">= 0"])
|
52
55
|
else
|
53
56
|
s.add_dependency(%q<httparty>, [">= 0"])
|
54
57
|
s.add_dependency(%q<json>, [">= 0"])
|
@@ -57,8 +60,8 @@ Gem::Specification.new do |s|
|
|
57
60
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
58
61
|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
59
62
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
60
|
-
s.add_dependency(%q<
|
61
|
-
s.add_dependency(%q<
|
63
|
+
s.add_dependency(%q<vcr>, [">= 0"])
|
64
|
+
s.add_dependency(%q<webmock>, [">= 0"])
|
62
65
|
end
|
63
66
|
else
|
64
67
|
s.add_dependency(%q<httparty>, [">= 0"])
|
@@ -68,8 +71,8 @@ Gem::Specification.new do |s|
|
|
68
71
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
69
72
|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
70
73
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
71
|
-
s.add_dependency(%q<
|
72
|
-
s.add_dependency(%q<
|
74
|
+
s.add_dependency(%q<vcr>, [">= 0"])
|
75
|
+
s.add_dependency(%q<webmock>, [">= 0"])
|
73
76
|
end
|
74
77
|
end
|
75
78
|
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://api.scribeseo.com/analysis/content?apikey=scribe-2c81aaba77ca4fc4bcf0a94812dd5e32&output=json
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ! '{"htmlTitle":"Stocks Claw Back","htmlDescription":"Stocks reversed
|
9
|
+
losses and inched higher, after elections in France and Greece fueled concerns
|
10
|
+
about the region''s ability to deal with its sovereign-debt problems.","htmlHeadline":"Stocks
|
11
|
+
Claw Back","htmlBody":"Stocks reversed losses and inched higher, after elections
|
12
|
+
in France and Greece fueled concerns about the region''s ability to deal with
|
13
|
+
its sovereign-debt problems. Stocks opened lower but recovered most losses
|
14
|
+
by Monday afternoon. The Dow Jones Industrial Average rose 10 points, or 0.1%,
|
15
|
+
to 13048. The Dow industrials fell as much as 68 points early in the session.
|
16
|
+
The Standard & Poor''s 500-stock index rose four points, or 0.3%, to 1373,
|
17
|
+
and the Nasdaq Composite rose 13 points, 0.4%, to 2969. Vincent Cignarella
|
18
|
+
and Michael Casey join Markets Hub with the U.S. reaction to weekend elections
|
19
|
+
in France and Greece, and what the new order will mean for the continent''s
|
20
|
+
debt struggles. Financial-sector stocks rose the most, with Bank of America
|
21
|
+
CVX -0.31% leading Dow components. Utility stocks trailed behind. Walt Disney
|
22
|
+
DIS +1.93% rose after its latest superhero action film, ''The Avengers,''
|
23
|
+
raked in over $200 million in its weekend box-office debut. Strong ticket
|
24
|
+
sales validated Disney''s $4 billion acquisition of Marvel Entertainment and
|
25
|
+
softened the blow of the recently disappointing ''John Carter.'' American
|
26
|
+
International Group AIG -3.37% slumped after the U.S. government agreed to
|
27
|
+
sell $5 billion of the insurer''s stock at $30.50 a share, representing a
|
28
|
+
7.1% discount to Friday''s closing price. Weekend elections across the Atlantic
|
29
|
+
initially jostled markets.","targetedKeyword":"stocks","domain":"http://online.wsj.com"}'
|
30
|
+
headers:
|
31
|
+
Content-Type:
|
32
|
+
- application/json
|
33
|
+
response:
|
34
|
+
status:
|
35
|
+
code: 200
|
36
|
+
message: OK
|
37
|
+
headers:
|
38
|
+
Date:
|
39
|
+
- Fri, 01 Jun 2012 21:46:32 GMT
|
40
|
+
Server:
|
41
|
+
- Microsoft-IIS/6.0
|
42
|
+
X-Powered-By:
|
43
|
+
- ASP.NET
|
44
|
+
X-Aspnet-Version:
|
45
|
+
- 2.0.50727
|
46
|
+
Content-Length:
|
47
|
+
- '1702'
|
48
|
+
Cache-Control:
|
49
|
+
- private
|
50
|
+
Content-Type:
|
51
|
+
- application/json
|
52
|
+
body:
|
53
|
+
encoding: US-ASCII
|
54
|
+
string: ! '{"docScore":59,"docScoreE":["BodyLen","Hyper"],"fleschScore":"very
|
55
|
+
difficult","keywords":[{"kwc":4.59,"kwd":3.12,"kwe":[],"kwf":5,"kwl":1,"kwlText":"Primary","kwo":"A","kwod":"Congratulations,
|
56
|
+
this term strikes a good balance between search optimization and copywriting
|
57
|
+
best practices.","kwp":"Very High","kwr":1,"kws":13.35,"text":"stocks"},{"kwc":0.81,"kwd":0.62,"kwe":["KwET","KwEM","KwELF"],"kwf":1,"kwl":4,"kwlText":"Not
|
58
|
+
Emphasized","kwo":"B","kwod":"To improve the ranking for this term, correct
|
59
|
+
the copywriting and\/or document issues found.","kwp":"Very Low","kwr":3,"kws":5.82,"text":"financial
|
60
|
+
sector stocks"},{"kwc":1.02,"kwd":1.25,"kwe":["KwET","KwEMP"],"kwf":2,"kwl":4,"kwlText":"Not
|
61
|
+
Emphasized","kwo":"B","kwod":"To improve the ranking for this term, correct
|
62
|
+
the copywriting and\/or document issues found.","kwp":"Very Low","kwr":2,"kws":6.27,"text":"sovereign
|
63
|
+
debt"},{"kwc":3.18,"kwd":1.25,"kwe":["KwEM"],"kwf":2,"kwl":2,"kwlText":"Important","kwo":"C","kwod":"While
|
64
|
+
your copywriting is strong, consider writing more about this topic on your
|
65
|
+
site and\/or use this term more frequently in your content.","kwp":"Very High","kwr":4,"kws":3.74,"text":"claw"},{"kwc":0.81,"kwd":0.62,"kwe":["KwET","KwEM","KwELF"],"kwf":1,"kwl":4,"kwlText":"Not
|
66
|
+
Emphasized","kwo":"D","kwod":"You will need to do some work for this term,
|
67
|
+
including improving your copywriting and writing more about this topic on
|
68
|
+
your site.","kwp":"Very Low","kwr":5,"kws":3.35,"text":"utility stocks"}],"scribeScore":89,"tags":["stocks","financial
|
69
|
+
sector stocks","sovereign debt","claw","utility stocks","economic history
|
70
|
+
of the united kingdom","stocks open lower","stocks reverse","sector stocks","economics","loss","reverse"]}'
|
71
|
+
http_version: !!null
|
72
|
+
recorded_at: Fri, 01 Jun 2012 21:46:32 GMT
|
73
|
+
recorded_with: VCR 2.2.0
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://api.scribeseo.com/analysis/kw/detail?apikey=scribe-2c81aaba77ca4fc4bcf0a94812dd5e32&output=json
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ! '{"query":"design","domain":"http://blog.iso50.com"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Date:
|
18
|
+
- Fri, 01 Jun 2012 21:48:52 GMT
|
19
|
+
Server:
|
20
|
+
- Microsoft-IIS/6.0
|
21
|
+
X-Powered-By:
|
22
|
+
- ASP.NET
|
23
|
+
X-Aspnet-Version:
|
24
|
+
- 2.0.50727
|
25
|
+
Content-Length:
|
26
|
+
- '365'
|
27
|
+
Cache-Control:
|
28
|
+
- private
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
body:
|
32
|
+
encoding: US-ASCII
|
33
|
+
string: ! '{"scoreDifficulty":62,"scoreContent":200,"scoreLinks":0,"scoreDomainAuthority":0,"scorePageAuthority":1,"scoreFacebookLikes":57,"scoreGenderMale":51,"scoreGenderFemale":49,"agePrimaryDescription":"Age
|
34
|
+
35 to 49","agePrimaryValue":35,"ageSecondaryDescription":"Age 25 to 34","ageSecondaryValue":30,"ppc":36.5,"volumeAnnual":2579222,"volumeMonthly":214935.16666666666}'
|
35
|
+
http_version: !!null
|
36
|
+
recorded_at: Fri, 01 Jun 2012 21:48:52 GMT
|
37
|
+
recorded_with: VCR 2.2.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://api.scribeseo.com/analysis/kw/suggestions?apikey=scribe-2c81aaba77ca4fc4bcf0a94812dd5e32&output=json
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ! '{"query":"horse"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Date:
|
18
|
+
- Fri, 01 Jun 2012 21:59:34 GMT
|
19
|
+
Server:
|
20
|
+
- Microsoft-IIS/6.0
|
21
|
+
X-Powered-By:
|
22
|
+
- ASP.NET
|
23
|
+
X-Aspnet-Version:
|
24
|
+
- 2.0.50727
|
25
|
+
Content-Length:
|
26
|
+
- '562'
|
27
|
+
Cache-Control:
|
28
|
+
- private
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
body:
|
32
|
+
encoding: US-ASCII
|
33
|
+
string: ! '{"suggestions":[{"term":"horse","competition":66,"popularity":19},{"term":"horses","competition":61,"popularity":10},{"term":"horse
|
34
|
+
supplies","competition":46,"popularity":5},{"term":"equine","competition":56,"popularity":4},{"term":"riding","competition":62,"popularity":4},{"term":"horse
|
35
|
+
tack","competition":48,"popularity":3},{"term":"horse riding footwear","competition":15,"popularity":3},{"term":"horse
|
36
|
+
health","competition":42,"popularity":3},{"term":"horse.com","competition":41,"popularity":3},{"term":"horse
|
37
|
+
blankets","competition":38,"popularity":3}]}'
|
38
|
+
http_version: !!null
|
39
|
+
recorded_at: Fri, 01 Jun 2012 21:59:34 GMT
|
40
|
+
recorded_with: VCR 2.2.0
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.scribeseo.com/membership/user/detail?apikey=scribe-2c81aaba77ca4fc4bcf0a94812dd5e32&output=json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Date:
|
18
|
+
- Fri, 01 Jun 2012 21:48:54 GMT
|
19
|
+
Server:
|
20
|
+
- Microsoft-IIS/6.0
|
21
|
+
X-Powered-By:
|
22
|
+
- ASP.NET
|
23
|
+
X-Aspnet-Version:
|
24
|
+
- 2.0.50727
|
25
|
+
Content-Length:
|
26
|
+
- '213'
|
27
|
+
Cache-Control:
|
28
|
+
- private
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
body:
|
32
|
+
encoding: US-ASCII
|
33
|
+
string: ! '{"accountStatus":1,"accountType":"developer","evaluations":[{"remaining":4986,"term":"monthly","total":5000,"type":"ContentAnalysis"},{"remaining":1988,"term":"monthly","total":2000,"type":"KeywordIdeaResearch"}]}'
|
34
|
+
http_version: !!null
|
35
|
+
recorded_at: Fri, 01 Jun 2012 21:48:54 GMT
|
36
|
+
recorded_with: VCR 2.2.0
|
data/test/helper.rb
CHANGED
@@ -3,10 +3,9 @@ require 'rubygems'
|
|
3
3
|
require 'bundler'
|
4
4
|
require 'test/unit'
|
5
5
|
require 'shoulda'
|
6
|
-
require 'matchy'
|
7
|
-
require 'fakeweb'
|
8
6
|
require 'ruby-debug'
|
9
|
-
|
7
|
+
require 'json'
|
8
|
+
require "vcr"
|
10
9
|
# FakeWeb.allow_net_connect = false
|
11
10
|
|
12
11
|
begin
|
@@ -23,7 +22,18 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
23
22
|
require 'scribe_api'
|
24
23
|
|
25
24
|
class Test::Unit::TestCase
|
25
|
+
VCR.configure do |c|
|
26
|
+
VCR.turn_on!
|
27
|
+
c.cassette_library_dir = 'test/fixtures/vcr_cassettes'
|
28
|
+
c.hook_into :webmock
|
29
|
+
WebMock.allow_net_connect!
|
30
|
+
end
|
31
|
+
|
26
32
|
def fixture_file( path )
|
27
33
|
Pathname(__FILE__).dirname.join(*path.split('/')).read
|
28
34
|
end
|
35
|
+
|
36
|
+
def api_key
|
37
|
+
JSON.parse(File.read("test/config.json"))["config"]["scribe_api_key"]
|
38
|
+
end
|
29
39
|
end
|
data/test/test_scribe_api.rb
CHANGED
@@ -1,28 +1,35 @@
|
|
1
1
|
require 'helper'
|
2
|
-
require 'open-uri'
|
3
2
|
|
4
3
|
class TestScribeApi < Test::Unit::TestCase
|
5
4
|
context "scribe_api" do
|
6
5
|
setup do
|
7
|
-
@key =
|
6
|
+
@key = api_key
|
7
|
+
@scribe = ScribeAPI.new( @key )
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
should "have keyword suggestions" do
|
11
|
+
VCR.insert_cassette("kw_suggestions", :record => :new_episodes)
|
12
|
+
|
13
|
+
params = { :keyword => "horse" }
|
14
|
+
suggestions = @scribe.keyword_suggestions( params )
|
15
|
+
|
16
|
+
assert_equal 10, suggestions["suggestions"].length
|
17
|
+
assert_equal "horse", suggestions["suggestions"][0]["term"]
|
18
|
+
end
|
16
19
|
|
17
20
|
should "have keyword details" do
|
18
|
-
|
21
|
+
VCR.insert_cassette("kw_details", :record => :new_episodes)
|
22
|
+
|
19
23
|
params = { :keyword => "design", :domain => "http://blog.iso50.com" }
|
20
24
|
details = @scribe.keyword_details( params )
|
21
|
-
|
25
|
+
|
26
|
+
assert_equal 15, details.keys.length
|
27
|
+
assert_equal 0, details["scoreDomainAuthority"]
|
22
28
|
end
|
23
29
|
|
24
30
|
should "have content analysis" do
|
25
|
-
|
31
|
+
VCR.insert_cassette("content_analysis", :record => :new_episodes)
|
32
|
+
|
26
33
|
params = { :title => "Stocks Claw Back" }
|
27
34
|
params[:description] = "Stocks reversed losses and inched higher, after elections in France and Greece fueled concerns about the region's ability to deal with its sovereign-debt problems."
|
28
35
|
params[:keyword] = "stocks"
|
@@ -30,20 +37,37 @@ class TestScribeApi < Test::Unit::TestCase
|
|
30
37
|
params[:domain] = "http://online.wsj.com"
|
31
38
|
params[:body] = "Stocks reversed losses and inched higher, after elections in France and Greece fueled concerns about the region's ability to deal with its sovereign-debt problems. Stocks opened lower but recovered most losses by Monday afternoon. The Dow Jones Industrial Average rose 10 points, or 0.1%, to 13048. The Dow industrials fell as much as 68 points early in the session. The Standard & Poor's 500-stock index rose four points, or 0.3%, to 1373, and the Nasdaq Composite rose 13 points, 0.4%, to 2969. Vincent Cignarella and Michael Casey join Markets Hub with the U.S. reaction to weekend elections in France and Greece, and what the new order will mean for the continent's debt struggles. Financial-sector stocks rose the most, with Bank of America CVX -0.31% leading Dow components. Utility stocks trailed behind. Walt Disney DIS +1.93% rose after its latest superhero action film, 'The Avengers,' raked in over $200 million in its weekend box-office debut. Strong ticket sales validated Disney's $4 billion acquisition of Marvel Entertainment and softened the blow of the recently disappointing 'John Carter.' American International Group AIG -3.37% slumped after the U.S. government agreed to sell $5 billion of the insurer's stock at $30.50 a share, representing a 7.1% discount to Friday's closing price. Weekend elections across the Atlantic initially jostled markets."
|
32
39
|
analysis = @scribe.content_analysis( params )
|
33
|
-
|
40
|
+
|
41
|
+
assert_equal 59, analysis["docScore"]
|
42
|
+
assert_equal ["BodyLen", "Hyper"], analysis["docScoreE"]
|
43
|
+
assert_equal "very difficult", analysis["fleschScore"]
|
44
|
+
assert_equal 5, analysis["keywords"].length
|
45
|
+
assert_equal 89, analysis["scribeScore"]
|
46
|
+
assert_equal 12, analysis["tags"].length
|
34
47
|
end
|
35
48
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
49
|
+
# Link Building doesn't yet work on the scribe api, so this
|
50
|
+
# should "have link building" do
|
51
|
+
# VCR.insert_cassette("link_building", :record => :new_episodes)
|
52
|
+
#
|
53
|
+
# @scribe = ScribeAPI.new( @key )
|
54
|
+
# params = { :keyword => "llama", :domain => "simcity.com" }
|
55
|
+
# link_building = @scribe.link_building( params )
|
56
|
+
#
|
57
|
+
# debugger
|
58
|
+
# end
|
42
59
|
|
43
60
|
should "have user info" do
|
44
|
-
|
61
|
+
VCR.insert_cassette("user_info", :record => :new_episodes)
|
62
|
+
|
45
63
|
info = @scribe.user_information
|
46
|
-
|
64
|
+
|
65
|
+
assert_equal 3, info.keys.length
|
66
|
+
assert_equal 1, info["accountStatus"]
|
67
|
+
end
|
68
|
+
|
69
|
+
teardown do
|
70
|
+
VCR.eject_cassette
|
47
71
|
end
|
48
72
|
end
|
49
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scribe_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-01 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &2157005240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2157005240
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &2157004400 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2157004400
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: shoulda
|
38
|
-
requirement: &
|
38
|
+
requirement: &2157003360 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2157003360
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rdoc
|
49
|
-
requirement: &
|
49
|
+
requirement: &2157002280 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.12'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2157002280
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: bundler
|
60
|
-
requirement: &
|
60
|
+
requirement: &2157001320 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.0.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2157001320
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: ruby-debug19
|
71
|
-
requirement: &
|
71
|
+
requirement: &2156999940 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2156999940
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: jeweler
|
82
|
-
requirement: &
|
82
|
+
requirement: &2156998940 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,29 +87,29 @@ dependencies:
|
|
87
87
|
version: 1.8.3
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2156998940
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
93
|
-
requirement: &
|
92
|
+
name: vcr
|
93
|
+
requirement: &2156997940 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - ! '>='
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0
|
98
|
+
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *2156997940
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
|
-
name:
|
104
|
-
requirement: &
|
103
|
+
name: webmock
|
104
|
+
requirement: &2156996760 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *2156996760
|
113
113
|
description: easily access the scribe api.
|
114
114
|
email: ianhenrysmith@gmail.com
|
115
115
|
executables: []
|
@@ -127,7 +127,10 @@ files:
|
|
127
127
|
- VERSION
|
128
128
|
- lib/scribe_api.rb
|
129
129
|
- scribe_api.gemspec
|
130
|
-
- test/fixtures.
|
130
|
+
- test/fixtures/vcr_cassettes/content_analysis.yml
|
131
|
+
- test/fixtures/vcr_cassettes/kw_details.yml
|
132
|
+
- test/fixtures/vcr_cassettes/kw_suggestions.yml
|
133
|
+
- test/fixtures/vcr_cassettes/user_info.yml
|
131
134
|
- test/helper.rb
|
132
135
|
- test/test_scribe_api.rb
|
133
136
|
homepage: http://github.com/ianisborn/scribe_api
|
@@ -145,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
148
|
version: '0'
|
146
149
|
segments:
|
147
150
|
- 0
|
148
|
-
hash:
|
151
|
+
hash: 511674539456716310
|
149
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
153
|
none: false
|
151
154
|
requirements:
|
data/test/fixtures.json
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
keyword suggestions:
|
2
|
-
{"scoreDifficulty":100,"scoreContent":2,"scoreLinks":0,"scoreDomainAuthority":0,"scorePageAuthority":1,"scoreFacebookLikes":0,"scoreGenderMale":50,"scoreGenderFemale":47,"agePrimaryDescription":"Age 35 to 49","agePrimaryValue":37,"ageSecondaryDescription":"Age 25 to 34","ageSecondaryValue":27,"ppc":0,"volumeAnnual":28735836,"volumeMonthly":2394653}
|
3
|
-
|
4
|
-
keyword details:
|
5
|
-
{"suggestions":[{"term":"horse","competition":66,"popularity":19},{"term":"horses","competition":61,"popularity":9},{"term":"equestrian","competition":57,"popularity":5},{"term":"riding","competition":62,"popularity":5},{"term":"horse health","competition":41,"popularity":4},{"term":"horse supplies","competition":46,"popularity":4},{"term":"equine","competition":56,"popularity":4},{"term":"horses for sale","competition":54,"popularity":3},{"term":"care","competition":71,"popularity":3},{"term":"games","competition":73,"popularity":3}]}
|
6
|
-
|
7
|
-
content analysis:
|
8
|
-
{"docScore":59,"docScoreE":["BodyLen","Hyper"],"fleschScore":"very difficult","keywords":[{"kwc":4.59,"kwd":4.38,"kwe":[],"kwf":7,"kwl":1,"kwlText":"Primary","kwo":"A","kwod":"Congratulations, this term strikes a good balance between search optimization and copywriting best practices.","kwp":"Very High","kwr":1,"kws":13.61,"text":"stocks"},{"kwc":1.22,"kwd":1.88,"kwe":["KwET"],"kwf":3,"kwl":4,"kwlText":"Not Emphasized","kwo":"B","kwod":"To improve the ranking for this term, correct the copywriting and\/or document issues found.","kwp":"Very Low","kwr":2,"kws":10.21,"text":"greece"},{"kwc":1.02,"kwd":1.25,"kwe":["KwET","KwEMP","KwELF"],"kwf":2,"kwl":4,"kwlText":"Not Emphasized","kwo":"B","kwod":"To improve the ranking for this term, correct the copywriting and\/or document issues found.","kwp":"Very Low","kwr":5,"kws":5.21,"text":"sovereign debt"},{"kwc":1.22,"kwd":1.88,"kwe":["KwET"],"kwf":3,"kwl":4,"kwlText":"Not Emphasized","kwo":"B","kwod":"To improve the ranking for this term, correct the copywriting and\/or document issues found.","kwp":"Very Low","kwr":4,"kws":9.69,"text":"france"},{"kwc":1.59,"kwd":1.25,"kwe":["KwELF"],"kwf":2,"kwl":4,"kwlText":"Not Emphasized","kwo":"B","kwod":"To improve the ranking for this term, correct the copywriting and\/or document issues found.","kwp":"Very Low","kwr":3,"kws":9.78,"text":"stock"},{"kwc":3.18,"kwd":1.25,"kwe":["KwEM","KwELF"],"kwf":2,"kwl":2,"kwlText":"Important","kwo":"C","kwod":"While your copywriting is strong, consider writing more about this topic on your site and\/or use this term more frequently in your content.","kwp":"Very High","kwr":6,"kws":3.61,"text":"claw"},{"kwc":1.02,"kwd":1.25,"kwe":["KwET","KwEMP","KwELF"],"kwf":2,"kwl":4,"kwlText":"Not Emphasized","kwo":"D","kwod":"You will need to do some work for this term, including improving your copywriting and writing more about this topic on your site.","kwp":"Very Low","kwr":7,"kws":4.03,"text":"ability"}],"scribeScore":92,"tags":["stocks","greece","sovereign debt","france","stock","claw","ability","economic history of the united kingdom","fuel","economics","reverse","loss","election"]}
|
9
|
-
|
10
|
-
link building:
|
11
|
-
(need this to work)
|
12
|
-
|
13
|
-
user info:
|
14
|
-
{"accountStatus":1,"accountType":"developer","evaluations":[{"remaining":1993,"term":"monthly","total":2000,"type":"KeywordIdeaResearch"},{"remaining":4999,"term":"monthly","total":5000,"type":"ContentAnalysis"}]}
|