scribe_api 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/scribe_api.rb CHANGED
@@ -18,26 +18,57 @@ class ScribeAPI
18
18
 
19
19
  def keyword_suggestions( params={} )
20
20
  options = { :body => { :query => params[:keyword] }.to_json }
21
- self.class.post( "/analysis/kw/suggestions?apikey=#{@key}", options )
21
+ httparty = self.class.post( "/analysis/kw/suggestions?apikey=#{@key}", options )
22
+ result = {}
23
+
24
+ if httparty.code == 200
25
+ result = httparty.parsed_response
26
+ end
27
+ result
22
28
  end
23
29
 
24
30
  def keyword_details( params={} )
25
31
  options = { :body => { :query => params[:keyword], :domain => params[:domain] }.to_json }
26
- self.class.post( "/analysis/kw/detail?apikey=#{@key}", options )
32
+ httparty = self.class.post( "/analysis/kw/detail?apikey=#{@key}", options )
33
+ result = {}
34
+
35
+ if httparty.code == 200
36
+ result = httparty.parsed_response
37
+ end
38
+ result
27
39
  end
28
40
 
29
41
  def content_analysis( params={} )
30
42
  options = { :body => { :htmlTitle => params[:title], :htmlDescription => params[:description], :htmlHeadline => params[:headline], :htmlBody => params[:body], :targetedKeyword => params[:keyword], :domain => params[:domain] }.to_json }
31
- self.class.post( "/analysis/content?apikey=#{@key}", options )
43
+ httparty = self.class.post( "/analysis/content?apikey=#{@key}", options )
44
+ result = {}
45
+
46
+ if httparty.code == 200
47
+ result = httparty.parsed_response
48
+ end
49
+ result
32
50
  end
33
51
 
34
52
  def link_building( params={} )
35
- options = { :body => { :query => params[:keyword], :domain => params[:domain] }.to_json }
36
- # this is disabled cause scribe is working on this endpt.
37
- # self.class.post( "/analysis/link?apikey=#{@key}", options )
53
+ # options = { :body => { :query => params[:keyword], :domain => params[:domain] }.to_json }
54
+ # httparty =self.class.post( "/analysis/link?apikey=#{@key}", options )
55
+ #
56
+ # if httparty.code == 200
57
+ # result = httparty.parsed_response
58
+ # end
59
+ # result
60
+
61
+ # return empty hash cause scribe is working on this endpt.
62
+ {}
38
63
  end
39
64
 
40
65
  def user_information( params={} )
41
- self.class.get( "/membership/user/detail?apikey=#{@key}" )
66
+ httparty = self.class.get( "/membership/user/detail?apikey=#{@key}" )
67
+ result = {}
68
+
69
+ if httparty.code == 200
70
+ result = httparty.parsed_response
71
+ end
72
+ result
42
73
  end
43
74
  end
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.2.0"
8
+ s.version = "0.2.1"
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-05-09}
12
+ s.date = %q{2012-05-10}
13
13
  s.description = %q{easily access the scribe api.}
14
14
  s.email = %q{ianhenrysmith@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -7,12 +7,12 @@ class TestScribeApi < Test::Unit::TestCase
7
7
  @key = "scribe-2c81aaba77ca4fc4bcf0a94812dd5e32"
8
8
  end
9
9
 
10
- should "have keyword suggestions" do
11
- @scribe = ScribeAPI.new( @key )
12
- params = { :keyword => "horse" }
13
- suggestions = @scribe.keyword_suggestions( params )
14
- puts suggestions
15
- end
10
+ # should "have keyword suggestions" do
11
+ # @scribe = ScribeAPI.new( @key )
12
+ # params = { :keyword => "horse" }
13
+ # suggestions = @scribe.keyword_suggestions( params )
14
+ # puts suggestions
15
+ # end
16
16
 
17
17
  should "have keyword details" do
18
18
  @scribe = ScribeAPI.new( @key )
@@ -20,7 +20,7 @@ class TestScribeApi < Test::Unit::TestCase
20
20
  details = @scribe.keyword_details( params )
21
21
  puts details
22
22
  end
23
-
23
+
24
24
  should "have content analysis" do
25
25
  @scribe = ScribeAPI.new( @key )
26
26
  params = { :title => "Stocks Claw Back" }
@@ -33,12 +33,12 @@ class TestScribeApi < Test::Unit::TestCase
33
33
  puts analysis
34
34
  end
35
35
 
36
- # should "have link building" do
37
- # @scribe = ScribeAPI.new( @key )
38
- # params = { :keyword => "llama", :domain => "simcity.com" }
39
- # link_building = @scribe.link_building( params )
40
- # puts link_building
41
- # end
36
+ should "have link building" do
37
+ @scribe = ScribeAPI.new( @key )
38
+ params = { :keyword => "llama", :domain => "simcity.com" }
39
+ link_building = @scribe.link_building( params )
40
+ puts link_building
41
+ end
42
42
 
43
43
  should "have user info" do
44
44
  @scribe = ScribeAPI.new( @key )
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.2.0
4
+ version: 0.2.1
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-05-09 00:00:00.000000000Z
12
+ date: 2012-05-10 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &2152366840 !ruby/object:Gem::Requirement
16
+ requirement: &2152233300 !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: *2152366840
24
+ version_requirements: *2152233300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &2152362220 !ruby/object:Gem::Requirement
27
+ requirement: &2152232260 !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: *2152362220
35
+ version_requirements: *2152232260
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda
38
- requirement: &2152361400 !ruby/object:Gem::Requirement
38
+ requirement: &2152230480 !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: *2152361400
46
+ version_requirements: *2152230480
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rdoc
49
- requirement: &2152360440 !ruby/object:Gem::Requirement
49
+ requirement: &2152229740 !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: *2152360440
57
+ version_requirements: *2152229740
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &2152359780 !ruby/object:Gem::Requirement
60
+ requirement: &2152228980 !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: *2152359780
68
+ version_requirements: *2152228980
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ruby-debug19
71
- requirement: &2152359100 !ruby/object:Gem::Requirement
71
+ requirement: &2152227600 !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: *2152359100
79
+ version_requirements: *2152227600
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: jeweler
82
- requirement: &2152358100 !ruby/object:Gem::Requirement
82
+ requirement: &2152226600 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.8.3
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2152358100
90
+ version_requirements: *2152226600
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: jnunemaker-matchy
93
- requirement: &2152356960 !ruby/object:Gem::Requirement
93
+ requirement: &2152225580 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - =
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 0.4.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2152356960
101
+ version_requirements: *2152225580
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: fakeweb
104
- requirement: &2152356100 !ruby/object:Gem::Requirement
104
+ requirement: &2152224760 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - =
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 1.3.0
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *2152356100
112
+ version_requirements: *2152224760
113
113
  description: easily access the scribe api.
114
114
  email: ianhenrysmith@gmail.com
115
115
  executables: []
@@ -145,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  segments:
147
147
  - 0
148
- hash: 1460378721273916177
148
+ hash: -1456804806659292886
149
149
  required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements: