yahoo_content_analysis 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/README.md +14 -2
- data/Rakefile +11 -1
- data/examples/text.rb +10 -0
- data/examples/uri.rb +10 -0
- data/lib/yahoo_content_analysis/client.rb +3 -4
- data/lib/yahoo_content_analysis/configuration.rb +0 -1
- data/lib/yahoo_content_analysis/connection.rb +1 -2
- data/lib/yahoo_content_analysis/response.rb +2 -2
- data/lib/yahoo_content_analysis/version.rb +1 -1
- data/test/client_test.rb +51 -8
- data/test/configuration_test.rb +20 -0
- data/test/response_test.rb +33 -0
- data/test/test_helper.rb +27 -0
- data/yahoo_content_analysis.gemspec +5 -1
- metadata +95 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5610866e5c197f3deaf637b4a712337d46d28a0
|
4
|
+
data.tar.gz: 239fe0ae8b71623793b9cd45a601474ea32908ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dcb125e31f5d3d84d81aa3fce40ebdc815c4e37faf087a82009a42d95336286a40dc8eb4e30ea9b5e82db692d2d1bfad434e4d67a780ea550a7f54f3c85cc5a
|
7
|
+
data.tar.gz: 9952e1c3e2625bf920b36d44fdb35949e8f75f1c0f82ea6be8ec827808448a545f14e731e35a53469082b7e116b6877f7eeae57048b8ff568c8e81826d2de7fc
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
# YahooContentAnalysis
|
2
2
|
|
3
|
+
[](http://opensource.org/licenses/MIT)
|
4
|
+
[](https://travis-ci.org/PRX/yahoo_content_analysis)
|
5
|
+
[](https://codeclimate.com/github/PRX/yahoo_content_analysis)
|
6
|
+
[](https://coveralls.io/r/PRX/yahoo_content_analysis?branch=master)
|
7
|
+
[](https://gemnasium.com/PRX/yahoo_content_analysis)
|
8
|
+
|
3
9
|
Use the Yahoo! Content Analysis API to extract topics and entities.
|
4
10
|
|
5
|
-
OAuth access is implemented, though not necessary (the docs imply higher
|
11
|
+
OAuth access is implemented, though not necessary (the docs imply higher limits if requests are signed). This should be a useful example for those wanting to do 2-legged OAuth access to Yahoo APIs using Faraday and the OAuth Faraday Middleware.
|
6
12
|
|
7
13
|
N.B. - I am not seeing the additional metadata nor related entities returned as the Yahoo docs claim they should.
|
8
14
|
|
@@ -24,13 +30,19 @@ Or install it yourself as:
|
|
24
30
|
```ruby
|
25
31
|
require 'yahoo_content_analysis'
|
26
32
|
|
27
|
-
YahooContentAnalysis.configure{|y|
|
33
|
+
YahooContentAnalysis.configure{|y|
|
28
34
|
y.api_key = ENV['YAHOO_API_KEY']
|
29
35
|
y.api_secret = ENV['YAHOO_API_SECRET']
|
30
36
|
}
|
31
37
|
|
32
38
|
r = YahooContentAnalysis::Client.new.analyze('Italian sculptors and painters of the renaissance favored the Virgin Mary for inspiration.')
|
33
39
|
|
40
|
+
names = r.entities.collect{|e| e.name}
|
41
|
+
|
42
|
+
# you can also query a uri
|
43
|
+
uri = 'http://www.npr.org/2015/06/03/411524156/in-search-of-the-red-cross-500-million-in-haiti-relief'
|
44
|
+
r = YahooContentAnalysis::Client.new.analyze(uri)
|
45
|
+
|
34
46
|
names = r.entities.collect{|e| e.name}
|
35
47
|
```
|
36
48
|
## Contributing
|
data/Rakefile
CHANGED
data/examples/text.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'yahoo_content_analysis'
|
2
|
+
|
3
|
+
YahooContentAnalysis.configure { |y|
|
4
|
+
y.api_key = ENV['YAHOO_API_KEY']
|
5
|
+
y.api_secret = ENV['YAHOO_API_SECRET']
|
6
|
+
}
|
7
|
+
|
8
|
+
text = 'Italian sculptors and painters of the renaissance favored the Virgin Mary for inspiration.'
|
9
|
+
r = YahooContentAnalysis::Client.new.analyze(text)
|
10
|
+
puts r.inspect
|
data/examples/uri.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'yahoo_content_analysis'
|
2
|
+
|
3
|
+
YahooContentAnalysis.configure { |y|
|
4
|
+
y.api_key = ENV['YAHOO_API_KEY']
|
5
|
+
y.api_secret = ENV['YAHOO_API_SECRET']
|
6
|
+
}
|
7
|
+
|
8
|
+
uri = 'http://www.npr.org/2015/06/03/411524156/in-search-of-the-red-cross-500-million-in-haiti-relief'
|
9
|
+
r = YahooContentAnalysis::Client.new.analyze(uri)
|
10
|
+
puts r.inspect
|
@@ -41,7 +41,7 @@ module YahooContentAnalysis
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def query(content)
|
44
|
-
"SELECT * FROM contentanalysis.analyze WHERE related_entities =
|
44
|
+
"SELECT * FROM contentanalysis.analyze WHERE related_entities = 'true' and #{condition(content)}"
|
45
45
|
end
|
46
46
|
|
47
47
|
def condition(content)
|
@@ -49,11 +49,11 @@ module YahooContentAnalysis
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def url(content)
|
52
|
-
%{ url =
|
52
|
+
%{ url = '#{content}' }
|
53
53
|
end
|
54
54
|
|
55
55
|
def text(content)
|
56
|
-
%{ text =
|
56
|
+
%{ text = '#{content.gsub("'", %q(\\\'))}' }
|
57
57
|
end
|
58
58
|
|
59
59
|
def options(content)
|
@@ -74,6 +74,5 @@ module YahooContentAnalysis
|
|
74
74
|
rescue URI::InvalidURIError
|
75
75
|
false
|
76
76
|
end
|
77
|
-
|
78
77
|
end
|
79
78
|
end
|
@@ -21,7 +21,7 @@ module YahooContentAnalysis
|
|
21
21
|
:headers => {
|
22
22
|
# generic http headers
|
23
23
|
'User-Agent' => user_agent,
|
24
|
-
'Accept' =>
|
24
|
+
'Accept' => 'application/json;charset=utf-8'
|
25
25
|
},
|
26
26
|
:ssl => {:verify => false},
|
27
27
|
:url => endpoint
|
@@ -50,6 +50,5 @@ module YahooContentAnalysis
|
|
50
50
|
nil
|
51
51
|
end
|
52
52
|
end
|
53
|
-
|
54
53
|
end
|
55
54
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
|
2
3
|
require 'language_list'
|
3
4
|
|
4
5
|
module YahooContentAnalysis
|
@@ -27,8 +28,8 @@ module YahooContentAnalysis
|
|
27
28
|
return if (!response.respond_to?(:body))
|
28
29
|
return if (!response.body['query'] || !response.body['query']['results'])
|
29
30
|
|
31
|
+
@language = get_language(response.body['query']['lang'])
|
30
32
|
r = response.body['query']['results']
|
31
|
-
@language = get_language(r['lang'])
|
32
33
|
|
33
34
|
yahoo_categories = (r['yctCategories'] || {})['yctCategory'] || []
|
34
35
|
yahoo_categories = [yahoo_categories] unless yahoo_categories.is_a?(Array)
|
@@ -79,6 +80,5 @@ module YahooContentAnalysis
|
|
79
80
|
content = (content[1] || content[0] || '').remove_formatting.titleize
|
80
81
|
content.blank? ? nil : content
|
81
82
|
end
|
82
|
-
|
83
83
|
end
|
84
84
|
end
|
data/test/client_test.rb
CHANGED
@@ -1,8 +1,51 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
describe YahooContentAnalysis::Client do
|
4
|
+
|
5
|
+
it 'is initialized with defaults' do
|
6
|
+
oc = YahooContentAnalysis::Client.new
|
7
|
+
oc.current_options.wont_be_nil
|
8
|
+
oc.current_options.must_equal YahooContentAnalysis.options
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'is initialized with specific values' do
|
12
|
+
oc = YahooContentAnalysis::Client.new(:api_key => 'current')
|
13
|
+
oc.current_options.wont_be_nil
|
14
|
+
oc.current_options.wont_equal YahooContentAnalysis.options
|
15
|
+
oc.current_options[:api_key].must_equal 'current'
|
16
|
+
oc.api_key.must_equal 'current'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'gets tags for text' do
|
20
|
+
|
21
|
+
body = "{\"query\":{\"count\":1,\"created\":\"2015-06-04T01:01:34Z\",\"lang\":\"en-US\",\"results\":{\"entities\":{\"entity\":[{\"score\":\"0.882\",\"text\":{\"end\":\"12\",\"endchar\":\"12\",\"start\":\"0\",\"startchar\":\"0\",\"content\":\"Ruby on Rails\"},\"wiki_url\":\"http://en.wikipedia.com/wiki/Ruby_on_Rails\"},{\"score\":\"0.701\",\"text\":{\"end\":\"41\",\"endchar\":\"41\",\"start\":\"29\",\"startchar\":\"29\",\"content\":\"web framework\"},\"wiki_url\":\"http://en.wikipedia.com/wiki/Web_application_framework\"},{\"score\":\"0.64\",\"text\":{\"end\":\"89\",\"endchar\":\"89\",\"start\":\"65\",\"startchar\":\"65\",\"content\":\"ruby programming language\"},\"wiki_url\":\"http://en.wikipedia.com/wiki/Ruby_%28programming_language%29\"}]}}}}"
|
22
|
+
|
23
|
+
stub_request(:post, "http://query.yahooapis.com/v1/public/yql").
|
24
|
+
with(:body => {"format"=>"json", "max"=>"50", "q"=>"SELECT * FROM contentanalysis.analyze WHERE related_entities = 'true' and text = 'Ruby on Rails is a fantastic web framework. It uses MVC, and the ruby programming language invented by Matz' ", "related_entities"=>"true", "show_metadata"=>"true"},
|
25
|
+
:headers => {'Accept'=>'application/json;charset=utf-8', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'query.yahooapis.com:80'}).
|
26
|
+
to_return(:status => 200, :body => body, :headers => {})
|
27
|
+
|
28
|
+
text = "Ruby on Rails is a fantastic web framework. It uses MVC, and the ruby programming language invented by Matz"
|
29
|
+
response = YahooContentAnalysis::Client.new.analyze(text)
|
30
|
+
response.wont_be_nil
|
31
|
+
response.raw.wont_be_nil
|
32
|
+
response.entities.count.must_equal 3
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'gets tags for a url' do
|
36
|
+
|
37
|
+
body = "{\"query\":{\"count\":2,\"created\":\"2015-06-04T01:18:24Z\",\"lang\":\"en-US\",\"results\":{\"yctCategories\":{\"yctCategory\":[{\"score\":\"0.952\",\"content\":\"Society & Culture\"},{\"score\":\"0.693333\",\"content\":\"Volunteering & Philanthropy\"},{\"score\":\"0.666667\",\"content\":\"Society & Culture Organizations\"}]},\"entities\":{\"entity\":[{\"score\":\"0.959\",\"text\":{\"end\":\"19248\",\"endchar\":\"19248\",\"start\":\"19236\",\"startchar\":\"19236\",\"content\":\"The Red Cross\"},\"wiki_url\":\"http://en.wikipedia.com/wiki/American_Red_Cross\"},{\"score\":\"0.943\",\"text\":{\"end\":\"36452\",\"endchar\":\"36443\",\"start\":\"36440\",\"startchar\":\"36431\",\"content\":\"The Red Cross\"}},{\"score\":\"0.93\",\"text\":{\"end\":\"19271\",\"endchar\":\"19271\",\"start\":\"19267\",\"startchar\":\"19267\",\"content\":\"Haiti\"},\"wiki_url\":\"http://en.wikipedia.com/wiki/Haiti\",\"types\":{\"type\":{\"region\":\"us\",\"content\":\"/place/destination\"}}},{\"score\":\"0.919\",\"text\":{\"end\":\"35722\",\"endchar\":\"35713\",\"start\":\"35714\",\"startchar\":\"35705\",\"content\":\"Red Cross\"},\"types\":{\"type\":{\"region\":\"us\",\"content\":\"/organization\"}}},{\"score\":\"0.916\",\"text\":{\"end\":\"35673\",\"endchar\":\"35664\",\"start\":\"35669\",\"startchar\":\"35660\",\"content\":\"Haiti\"},\"types\":{\"type\":[{\"region\":\"us\",\"content\":\"/place\"},{\"region\":\"us\",\"content\":\"/place/destination\"}]}},{\"score\":\"0.87\",\"text\":{\"end\":\"31454\",\"endchar\":\"31445\",\"start\":\"31444\",\"startchar\":\"31435\",\"content\":\"Marie Arago\"},\"types\":{\"type\":{\"region\":\"us\",\"content\":\"/person\"}}},{\"score\":\"0.583\",\"text\":{\"end\":\"36220\",\"endchar\":\"36211\",\"start\":\"36208\",\"startchar\":\"36199\",\"content\":\"David Meltzer\"},\"types\":{\"type\":{\"region\":\"us\",\"content\":\"/person\"}}}]}}}}"
|
38
|
+
|
39
|
+
|
40
|
+
stub_request(:post, "http://query.yahooapis.com/v1/public/yql").
|
41
|
+
with(:body => {"format"=>"json", "max"=>"50", "q"=>"SELECT * FROM contentanalysis.analyze WHERE related_entities = 'true' and url = 'http://www.npr.org/2015/06/03/411524156/in-search-of-the-red-cross-500-million-in-haiti-relief' ", "related_entities"=>"true", "show_metadata"=>"true"},
|
42
|
+
:headers => {'Accept'=>'application/json;charset=utf-8', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'query.yahooapis.com:80'}).
|
43
|
+
to_return(:status => 200, :body => body, :headers => {})
|
44
|
+
|
45
|
+
uri = 'http://www.npr.org/2015/06/03/411524156/in-search-of-the-red-cross-500-million-in-haiti-relief'
|
46
|
+
response = YahooContentAnalysis::Client.new.analyze(uri)
|
47
|
+
response.wont_be_nil
|
48
|
+
response.raw.wont_be_nil
|
49
|
+
response.entities.count.must_equal 5
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module TestConfig
|
4
|
+
extend YahooContentAnalysis::Configuration
|
5
|
+
end
|
6
|
+
|
7
|
+
describe YahooContentAnalysis::Configuration do
|
8
|
+
|
9
|
+
let(:config) { YahooContentAnalysis::Configuration }
|
10
|
+
|
11
|
+
it 'can be configured' do
|
12
|
+
TestConfig.configure do |c|
|
13
|
+
c.must_be_kind_of config
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'has default keys' do
|
18
|
+
config.keys.must_equal config::VALID_OPTIONS_KEYS
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
describe YahooContentAnalysis::Response do
|
4
|
+
|
5
|
+
it 'is initialized with json' do
|
6
|
+
oc = YahooContentAnalysis::Response.new("{}")
|
7
|
+
oc.wont_be_nil
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'gets tags for text' do
|
11
|
+
|
12
|
+
body = {"query"=>{"count"=>1, "created"=>"2015-06-04T01:01:34Z", "lang"=>"en-US", "results"=>{"entities"=>{"entity"=>[{"score"=>"0.882", "text"=>{"end"=>"12", "endchar"=>"12", "start"=>"0", "startchar"=>"0", "content"=>"Ruby on Rails"}, "wiki_url"=>"http://en.wikipedia.com/wiki/Ruby_on_Rails"}, {"score"=>"0.701", "text"=>{"end"=>"41", "endchar"=>"41", "start"=>"29", "startchar"=>"29", "content"=>"web framework"}, "wiki_url"=>"http://en.wikipedia.com/wiki/Web_application_framework"}, {"score"=>"0.64", "text"=>{"end"=>"89", "endchar"=>"89", "start"=>"65", "startchar"=>"65", "content"=>"ruby programming language"}, "wiki_url"=>"http://en.wikipedia.com/wiki/Ruby_%28programming_language%29"}]}}}}
|
13
|
+
|
14
|
+
mock_message = Minitest::Mock.new
|
15
|
+
4.times { mock_message.expect(:body, body) }
|
16
|
+
mock_message.expect(:nil?, false)
|
17
|
+
|
18
|
+
response = YahooContentAnalysis::Response.new(mock_message)
|
19
|
+
response.entities.count.must_equal 3
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'gets tags for a url' do
|
23
|
+
|
24
|
+
body = {"query"=>{"count"=>2, "created"=>"2015-06-04T01:18:24Z", "lang"=>"en-US", "results"=>{"yctCategories"=>{"yctCategory"=>[{"score"=>"0.952", "content"=>"Society & Culture"}, {"score"=>"0.693333", "content"=>"Volunteering & Philanthropy"}, {"score"=>"0.666667", "content"=>"Society & Culture Organizations"}]}, "entities"=>{"entity"=>[{"score"=>"0.959", "text"=>{"end"=>"19248", "endchar"=>"19248", "start"=>"19236", "startchar"=>"19236", "content"=>"The Red Cross"}, "wiki_url"=>"http://en.wikipedia.com/wiki/American_Red_Cross"}, {"score"=>"0.943", "text"=>{"end"=>"36452", "endchar"=>"36443", "start"=>"36440", "startchar"=>"36431", "content"=>"The Red Cross"}}, {"score"=>"0.93", "text"=>{"end"=>"19271", "endchar"=>"19271", "start"=>"19267", "startchar"=>"19267", "content"=>"Haiti"}, "wiki_url"=>"http://en.wikipedia.com/wiki/Haiti", "types"=>{"type"=>{"region"=>"us", "content"=>"/place/destination"}}}, {"score"=>"0.919", "text"=>{"end"=>"35722", "endchar"=>"35713", "start"=>"35714", "startchar"=>"35705", "content"=>"Red Cross"}, "types"=>{"type"=>{"region"=>"us", "content"=>"/organization"}}}, {"score"=>"0.916", "text"=>{"end"=>"35673", "endchar"=>"35664", "start"=>"35669", "startchar"=>"35660", "content"=>"Haiti"}, "types"=>{"type"=>[{"region"=>"us", "content"=>"/place"}, {"region"=>"us", "content"=>"/place/destination"}]}}, {"score"=>"0.87", "text"=>{"end"=>"31454", "endchar"=>"31445", "start"=>"31444", "startchar"=>"31435", "content"=>"Marie Arago"}, "types"=>{"type"=>{"region"=>"us", "content"=>"/person"}}}, {"score"=>"0.583", "text"=>{"end"=>"36220", "endchar"=>"36211", "start"=>"36208", "startchar"=>"36199", "content"=>"David Meltzer"}, "types"=>{"type"=>{"region"=>"us", "content"=>"/person"}}}]}}}}
|
25
|
+
|
26
|
+
mock_message = Minitest::Mock.new
|
27
|
+
4.times { mock_message.expect(:body, body) }
|
28
|
+
mock_message.expect(:nil?, false)
|
29
|
+
|
30
|
+
response = YahooContentAnalysis::Response.new(mock_message)
|
31
|
+
response.entities.count.must_equal 5
|
32
|
+
end
|
33
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
# ENV['EXCON_DEBUG'] = 'true'
|
4
|
+
|
5
|
+
require 'simplecov'
|
6
|
+
SimpleCov.start
|
7
|
+
|
8
|
+
if ENV['TRAVIS']
|
9
|
+
require 'coveralls'
|
10
|
+
Coveralls.wear!
|
11
|
+
end
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
14
|
+
|
15
|
+
require 'minitest'
|
16
|
+
require 'minitest/autorun'
|
17
|
+
require 'minitest/spec'
|
18
|
+
require 'minitest/mock'
|
19
|
+
require 'webmock/minitest'
|
20
|
+
require 'hashie/mash'
|
21
|
+
|
22
|
+
require 'yahoo_content_analysis'
|
23
|
+
|
24
|
+
YahooContentAnalysis.configure do |y|
|
25
|
+
y.api_key = ENV['YAHOO_API_KEY'] || 'test_api_key'
|
26
|
+
y.api_secret = ENV['YAHOO_API_SECRET'] || 'test_api_secret'
|
27
|
+
end
|
@@ -17,9 +17,10 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_runtime_dependency('faraday',
|
20
|
+
gem.add_runtime_dependency('faraday', '>= 0.7.4')
|
21
21
|
gem.add_runtime_dependency('faraday_middleware', '~> 0.9')
|
22
22
|
gem.add_runtime_dependency('multi_json', '>= 1.0.3', '~> 1.0')
|
23
|
+
gem.add_runtime_dependency('multi_xml')
|
23
24
|
gem.add_runtime_dependency('excon')
|
24
25
|
gem.add_runtime_dependency('hashie', '>= 0.4.0')
|
25
26
|
gem.add_runtime_dependency('simple_oauth')
|
@@ -29,4 +30,7 @@ Gem::Specification.new do |gem|
|
|
29
30
|
|
30
31
|
gem.add_development_dependency('rake')
|
31
32
|
gem.add_development_dependency('minitest')
|
33
|
+
gem.add_development_dependency('simplecov')
|
34
|
+
gem.add_development_dependency('coveralls')
|
35
|
+
gem.add_development_dependency('webmock')
|
32
36
|
end
|
metadata
CHANGED
@@ -1,179 +1,229 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yahoo_content_analysis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kuklewicz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.7.4
|
20
|
-
- - ~>
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '0.9'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.7.4
|
30
|
-
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0.9'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: faraday_middleware
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - ~>
|
31
|
+
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
33
|
version: '0.9'
|
40
34
|
type: :runtime
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
|
-
- - ~>
|
38
|
+
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
40
|
version: '0.9'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: multi_json
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 1.0.3
|
54
|
-
- - ~>
|
48
|
+
- - "~>"
|
55
49
|
- !ruby/object:Gem::Version
|
56
50
|
version: '1.0'
|
57
51
|
type: :runtime
|
58
52
|
prerelease: false
|
59
53
|
version_requirements: !ruby/object:Gem::Requirement
|
60
54
|
requirements:
|
61
|
-
- -
|
55
|
+
- - ">="
|
62
56
|
- !ruby/object:Gem::Version
|
63
57
|
version: 1.0.3
|
64
|
-
- - ~>
|
58
|
+
- - "~>"
|
65
59
|
- !ruby/object:Gem::Version
|
66
60
|
version: '1.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: multi_xml
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
67
75
|
- !ruby/object:Gem::Dependency
|
68
76
|
name: excon
|
69
77
|
requirement: !ruby/object:Gem::Requirement
|
70
78
|
requirements:
|
71
|
-
- -
|
79
|
+
- - ">="
|
72
80
|
- !ruby/object:Gem::Version
|
73
81
|
version: '0'
|
74
82
|
type: :runtime
|
75
83
|
prerelease: false
|
76
84
|
version_requirements: !ruby/object:Gem::Requirement
|
77
85
|
requirements:
|
78
|
-
- -
|
86
|
+
- - ">="
|
79
87
|
- !ruby/object:Gem::Version
|
80
88
|
version: '0'
|
81
89
|
- !ruby/object:Gem::Dependency
|
82
90
|
name: hashie
|
83
91
|
requirement: !ruby/object:Gem::Requirement
|
84
92
|
requirements:
|
85
|
-
- -
|
93
|
+
- - ">="
|
86
94
|
- !ruby/object:Gem::Version
|
87
95
|
version: 0.4.0
|
88
96
|
type: :runtime
|
89
97
|
prerelease: false
|
90
98
|
version_requirements: !ruby/object:Gem::Requirement
|
91
99
|
requirements:
|
92
|
-
- -
|
100
|
+
- - ">="
|
93
101
|
- !ruby/object:Gem::Version
|
94
102
|
version: 0.4.0
|
95
103
|
- !ruby/object:Gem::Dependency
|
96
104
|
name: simple_oauth
|
97
105
|
requirement: !ruby/object:Gem::Requirement
|
98
106
|
requirements:
|
99
|
-
- -
|
107
|
+
- - ">="
|
100
108
|
- !ruby/object:Gem::Version
|
101
109
|
version: '0'
|
102
110
|
type: :runtime
|
103
111
|
prerelease: false
|
104
112
|
version_requirements: !ruby/object:Gem::Requirement
|
105
113
|
requirements:
|
106
|
-
- -
|
114
|
+
- - ">="
|
107
115
|
- !ruby/object:Gem::Version
|
108
116
|
version: '0'
|
109
117
|
- !ruby/object:Gem::Dependency
|
110
118
|
name: language_list
|
111
119
|
requirement: !ruby/object:Gem::Requirement
|
112
120
|
requirements:
|
113
|
-
- -
|
121
|
+
- - ">="
|
114
122
|
- !ruby/object:Gem::Version
|
115
123
|
version: '0'
|
116
124
|
type: :runtime
|
117
125
|
prerelease: false
|
118
126
|
version_requirements: !ruby/object:Gem::Requirement
|
119
127
|
requirements:
|
120
|
-
- -
|
128
|
+
- - ">="
|
121
129
|
- !ruby/object:Gem::Version
|
122
130
|
version: '0'
|
123
131
|
- !ruby/object:Gem::Dependency
|
124
132
|
name: activesupport
|
125
133
|
requirement: !ruby/object:Gem::Requirement
|
126
134
|
requirements:
|
127
|
-
- -
|
135
|
+
- - ">="
|
128
136
|
- !ruby/object:Gem::Version
|
129
137
|
version: '0'
|
130
138
|
type: :runtime
|
131
139
|
prerelease: false
|
132
140
|
version_requirements: !ruby/object:Gem::Requirement
|
133
141
|
requirements:
|
134
|
-
- -
|
142
|
+
- - ">="
|
135
143
|
- !ruby/object:Gem::Version
|
136
144
|
version: '0'
|
137
145
|
- !ruby/object:Gem::Dependency
|
138
146
|
name: stringex
|
139
147
|
requirement: !ruby/object:Gem::Requirement
|
140
148
|
requirements:
|
141
|
-
- -
|
149
|
+
- - ">="
|
142
150
|
- !ruby/object:Gem::Version
|
143
151
|
version: '0'
|
144
152
|
type: :runtime
|
145
153
|
prerelease: false
|
146
154
|
version_requirements: !ruby/object:Gem::Requirement
|
147
155
|
requirements:
|
148
|
-
- -
|
156
|
+
- - ">="
|
149
157
|
- !ruby/object:Gem::Version
|
150
158
|
version: '0'
|
151
159
|
- !ruby/object:Gem::Dependency
|
152
160
|
name: rake
|
153
161
|
requirement: !ruby/object:Gem::Requirement
|
154
162
|
requirements:
|
155
|
-
- -
|
163
|
+
- - ">="
|
156
164
|
- !ruby/object:Gem::Version
|
157
165
|
version: '0'
|
158
166
|
type: :development
|
159
167
|
prerelease: false
|
160
168
|
version_requirements: !ruby/object:Gem::Requirement
|
161
169
|
requirements:
|
162
|
-
- -
|
170
|
+
- - ">="
|
163
171
|
- !ruby/object:Gem::Version
|
164
172
|
version: '0'
|
165
173
|
- !ruby/object:Gem::Dependency
|
166
174
|
name: minitest
|
167
175
|
requirement: !ruby/object:Gem::Requirement
|
168
176
|
requirements:
|
169
|
-
- -
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
type: :development
|
181
|
+
prerelease: false
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
|
+
- !ruby/object:Gem::Dependency
|
188
|
+
name: simplecov
|
189
|
+
requirement: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '0'
|
194
|
+
type: :development
|
195
|
+
prerelease: false
|
196
|
+
version_requirements: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '0'
|
201
|
+
- !ruby/object:Gem::Dependency
|
202
|
+
name: coveralls
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ">="
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
type: :development
|
209
|
+
prerelease: false
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
- !ruby/object:Gem::Dependency
|
216
|
+
name: webmock
|
217
|
+
requirement: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ">="
|
170
220
|
- !ruby/object:Gem::Version
|
171
221
|
version: '0'
|
172
222
|
type: :development
|
173
223
|
prerelease: false
|
174
224
|
version_requirements: !ruby/object:Gem::Requirement
|
175
225
|
requirements:
|
176
|
-
- -
|
226
|
+
- - ">="
|
177
227
|
- !ruby/object:Gem::Version
|
178
228
|
version: '0'
|
179
229
|
description: Use the Yahoo! Content Analysis API to extract topics and entities.
|
@@ -183,11 +233,14 @@ executables: []
|
|
183
233
|
extensions: []
|
184
234
|
extra_rdoc_files: []
|
185
235
|
files:
|
186
|
-
- .gitignore
|
236
|
+
- ".gitignore"
|
237
|
+
- ".travis.yml"
|
187
238
|
- Gemfile
|
188
239
|
- LICENSE.txt
|
189
240
|
- README.md
|
190
241
|
- Rakefile
|
242
|
+
- examples/text.rb
|
243
|
+
- examples/uri.rb
|
191
244
|
- lib/yahoo_content_analysis.rb
|
192
245
|
- lib/yahoo_content_analysis/client.rb
|
193
246
|
- lib/yahoo_content_analysis/configuration.rb
|
@@ -195,6 +248,9 @@ files:
|
|
195
248
|
- lib/yahoo_content_analysis/response.rb
|
196
249
|
- lib/yahoo_content_analysis/version.rb
|
197
250
|
- test/client_test.rb
|
251
|
+
- test/configuration_test.rb
|
252
|
+
- test/response_test.rb
|
253
|
+
- test/test_helper.rb
|
198
254
|
- yahoo_content_analysis.gemspec
|
199
255
|
homepage: https://github.com/PRX/yahoo_content_analysis
|
200
256
|
licenses: []
|
@@ -205,19 +261,22 @@ require_paths:
|
|
205
261
|
- lib
|
206
262
|
required_ruby_version: !ruby/object:Gem::Requirement
|
207
263
|
requirements:
|
208
|
-
- -
|
264
|
+
- - ">="
|
209
265
|
- !ruby/object:Gem::Version
|
210
266
|
version: '0'
|
211
267
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
268
|
requirements:
|
213
|
-
- -
|
269
|
+
- - ">="
|
214
270
|
- !ruby/object:Gem::Version
|
215
271
|
version: '0'
|
216
272
|
requirements: []
|
217
273
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.
|
274
|
+
rubygems_version: 2.4.5
|
219
275
|
signing_key:
|
220
276
|
specification_version: 4
|
221
277
|
summary: Use the Yahoo! Content Analysis API to extract topics and entities.
|
222
278
|
test_files:
|
223
279
|
- test/client_test.rb
|
280
|
+
- test/configuration_test.rb
|
281
|
+
- test/response_test.rb
|
282
|
+
- test/test_helper.rb
|