datarank 0.2 → 1.0.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 +7 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +2 -2
- data/Gemfile +8 -0
- data/Gemfile.lock +16 -5
- data/README.md +9 -5
- data/Rakefile +1 -0
- data/datarank.gemspec +3 -6
- data/lib/datarank.rb +5 -5
- data/lib/datarank/client.rb +23 -1
- data/lib/datarank/comments.rb +10 -0
- data/lib/datarank/datasources.rb +24 -0
- data/lib/datarank/fizzle.rb +34 -0
- data/lib/datarank/live.rb +24 -0
- data/lib/datarank/locations.rb +24 -0
- data/lib/datarank/reach.rb +17 -0
- data/lib/datarank/retailers.rb +17 -0
- data/lib/datarank/sentiment.rb +17 -0
- data/lib/datarank/themes.rb +32 -0
- data/lib/datarank/topics.rb +15 -0
- data/lib/datarank/version.rb +12 -1
- data/lib/datarank/volume.rb +17 -0
- data/lib/datarank/wordcloud.rb +18 -0
- data/spec/datarank_spec.rb +17 -0
- data/spec/spec_helper.rb +45 -0
- metadata +21 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c79c39f0bddf6c27bbde8513e3826f62fbb9dbac
|
4
|
+
data.tar.gz: 4423093bb1ccfbe57c08ede5127142aae82fee4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73bce6af67c1ba008efb922463f22eeb7d1f7baa1f30439229a83ed2c09461c62606fbb953889e6bf325deba7b40e6a4c1d339f9ae94409d55cf695112ca624d
|
7
|
+
data.tar.gz: 602a60993a05a92f2fc767f12ce5f1bad8f6da409625c8f0a6dd801594fa0b05e4d9536df0b582818ea9c5a22dd8dc0614dc280a01f5042efa65524c03d81a44
|
data/.travis.yml
ADDED
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--no-private
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
0.1
|
1
|
+
0.1-0.2
|
2
2
|
---
|
3
|
-
Alpha release of DataRank Ruby Library
|
3
|
+
Alpha release of DataRank Ruby Library
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
datarank (0.
|
4
|
+
datarank (1.0.0)
|
5
5
|
hashie (>= 1.2.0)
|
6
6
|
httparty (>= 0.8.3)
|
7
7
|
multi_json (>= 1.3.4)
|
@@ -9,11 +9,15 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
+
addressable (2.3.6)
|
12
13
|
celluloid (0.16.0)
|
13
14
|
timers (~> 4.0.0)
|
15
|
+
codeclimate-test-reporter (0.4.3)
|
16
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
14
17
|
coderay (1.1.0)
|
18
|
+
crack (0.4.2)
|
19
|
+
safe_yaml (~> 1.0.0)
|
15
20
|
diff-lcs (1.2.5)
|
16
|
-
fakeweb (1.3.0)
|
17
21
|
ffi (1.9.6)
|
18
22
|
formatador (0.2.5)
|
19
23
|
guard (2.10.1)
|
@@ -58,6 +62,7 @@ GEM
|
|
58
62
|
rspec-expectations (2.99.2)
|
59
63
|
diff-lcs (>= 1.1.3, < 2.0)
|
60
64
|
rspec-mocks (2.99.2)
|
65
|
+
safe_yaml (1.0.4)
|
61
66
|
simplecov (0.7.1)
|
62
67
|
multi_json (~> 1.0)
|
63
68
|
simplecov-html (~> 0.7.1)
|
@@ -66,18 +71,24 @@ GEM
|
|
66
71
|
thor (0.18.1)
|
67
72
|
timers (4.0.1)
|
68
73
|
hitimes
|
74
|
+
vcr (2.9.3)
|
75
|
+
webmock (1.20.4)
|
76
|
+
addressable (>= 2.3.6)
|
77
|
+
crack (>= 0.3.2)
|
69
78
|
yard (0.8.7.6)
|
70
79
|
|
71
80
|
PLATFORMS
|
72
81
|
ruby
|
73
82
|
|
74
83
|
DEPENDENCIES
|
84
|
+
codeclimate-test-reporter
|
75
85
|
datarank!
|
76
|
-
fakeweb (~> 1.3.0)
|
77
86
|
guard-rspec
|
78
87
|
guard-yard
|
79
88
|
pry
|
80
89
|
rake
|
81
|
-
rspec
|
82
|
-
simplecov
|
90
|
+
rspec
|
91
|
+
simplecov
|
92
|
+
vcr (~> 2.9.0)
|
93
|
+
webmock (>= 1.18.0)
|
83
94
|
yard
|
data/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# DataRank API Ruby Library
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/datarank)
|
4
|
+
[](https://travis-ci.org/datarank/datarank-ruby/master)
|
5
|
+
[](https://codeclimate.com/github/datarank/
|
6
|
+
datarank-ruby)
|
7
|
+
|
3
8
|
## Documentation
|
4
9
|
|
5
10
|
[http://www.rubydoc.info/github/datarank/datarank-ruby/master](http://www.rubydoc.info/github/datarank/datarank-ruby/master)
|
@@ -10,26 +15,25 @@
|
|
10
15
|
|
11
16
|
## Getting Started
|
12
17
|
|
13
|
-
Using bundler, datarank will be automatically included for your project through your gemfile. If you would like to interactively play with the API, use `bundle console`.
|
14
18
|
|
15
19
|
**Instance method usage:**
|
16
20
|
```ruby
|
17
|
-
client = Datarank::Client.new(api_key,api_version)
|
21
|
+
client = Datarank::Client.new(api_key, api_version)
|
18
22
|
topics = client.all_topics
|
19
23
|
```
|
20
24
|
|
21
25
|
### Authentication
|
22
26
|
|
23
27
|
```ruby
|
24
|
-
client = Datarank::Client.new(api_key,api_version)
|
28
|
+
client = Datarank::Client.new(api_key, api_version)
|
25
29
|
```
|
26
30
|
|
27
31
|
## More Examples
|
28
32
|
|
29
|
-
**
|
33
|
+
**Fetch comments for a topic**
|
30
34
|
|
31
35
|
```ruby
|
32
|
-
client = Datarank::Client.new(api_key,api_version)
|
36
|
+
client = Datarank::Client.new(api_key, api_version)
|
33
37
|
comments = client.comments_search "tide-pods", {limit: 10}
|
34
38
|
```
|
35
39
|
|
data/Rakefile
CHANGED
data/datarank.gemspec
CHANGED
@@ -5,22 +5,19 @@ require 'datarank/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "datarank"
|
8
|
-
gem.version = Datarank::
|
8
|
+
gem.version = Datarank::Version.to_s
|
9
9
|
gem.authors = ["Addam Hardy"]
|
10
10
|
gem.email = ["addam@datarank.com"]
|
11
|
-
gem.description =
|
11
|
+
gem.description = "Ruby Wrapper for the DataRank REST API"
|
12
12
|
gem.summary = [""]
|
13
|
-
gem.homepage = "
|
13
|
+
gem.homepage = "https://github.com/datarank/datarank-ruby"
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_development_dependency "rspec", "~> 2.12"
|
21
|
-
gem.add_development_dependency "fakeweb", "~> 1.3.0"
|
22
20
|
gem.add_development_dependency "rake"
|
23
|
-
gem.add_development_dependency 'simplecov', '~> 0.7.1'
|
24
21
|
|
25
22
|
gem.add_dependency "httparty", ">= 0.8.3"
|
26
23
|
gem.add_dependency "multi_json", ">= 1.3.4"
|
data/lib/datarank.rb
CHANGED
@@ -16,12 +16,12 @@ module Datarank
|
|
16
16
|
client.respond_to?(method_name, include_private) || super
|
17
17
|
end
|
18
18
|
|
19
|
-
private
|
19
|
+
# private
|
20
20
|
|
21
|
-
def method_missing(method_name, *args, &block)
|
22
|
-
|
23
|
-
|
24
|
-
end
|
21
|
+
# def method_missing(method_name, *args, &block)
|
22
|
+
# return super unless client.respond_to?(method_name)
|
23
|
+
# client.send(method_name, *args, &block)
|
24
|
+
# end
|
25
25
|
|
26
26
|
end
|
27
27
|
end
|
data/lib/datarank/client.rb
CHANGED
@@ -4,8 +4,18 @@ require 'hashie'
|
|
4
4
|
require 'time'
|
5
5
|
require 'securerandom'
|
6
6
|
|
7
|
-
require "datarank/topics"
|
8
7
|
require "datarank/comments"
|
8
|
+
require "datarank/datasources"
|
9
|
+
require "datarank/fizzle"
|
10
|
+
require "datarank/live"
|
11
|
+
require "datarank/locations"
|
12
|
+
require "datarank/reach"
|
13
|
+
require "datarank/retailers"
|
14
|
+
require "datarank/sentiment"
|
15
|
+
require "datarank/themes"
|
16
|
+
require "datarank/topics"
|
17
|
+
require "datarank/volume"
|
18
|
+
require "datarank/wordcloud"
|
9
19
|
|
10
20
|
module Datarank
|
11
21
|
class Client
|
@@ -13,6 +23,17 @@ module Datarank
|
|
13
23
|
|
14
24
|
include Datarank::Client::Topics
|
15
25
|
include Datarank::Client::Comments
|
26
|
+
include Datarank::Client::Datasources
|
27
|
+
include Datarank::Client::Fizzle
|
28
|
+
include Datarank::Client::Live
|
29
|
+
include Datarank::Client::Locations
|
30
|
+
include Datarank::Client::Reach
|
31
|
+
include Datarank::Client::Retailers
|
32
|
+
include Datarank::Client::Sentiment
|
33
|
+
include Datarank::Client::Themes
|
34
|
+
include Datarank::Client::Volume
|
35
|
+
include Datarank::Client::Wordcloud
|
36
|
+
|
16
37
|
|
17
38
|
BASE_URI = 'https://api.datarank.com'
|
18
39
|
|
@@ -65,6 +86,7 @@ module Datarank
|
|
65
86
|
request_options[:headers] = headers
|
66
87
|
|
67
88
|
r = self.class.send(verb, path, request_options)
|
89
|
+
# FIXME: raise errors on actual error packages
|
68
90
|
hash = Hashie::Mash.new(JSON.parse(r.body))
|
69
91
|
raise Error.new(hash.error) if hash.error
|
70
92
|
raise Error.new(hash.errors.join(", ")) if hash.errors
|
data/lib/datarank/comments.rb
CHANGED
@@ -1,9 +1,19 @@
|
|
1
1
|
module Datarank
|
2
2
|
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with comments
|
3
5
|
module Comments
|
6
|
+
|
7
|
+
# Query interface for comments correlated to a topic
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
# @option options [1..1000] :limit The number of items to return.
|
11
|
+
# @option options - all query options available in API docs
|
4
12
|
def comments_search(slug, options={})
|
5
13
|
get "/topics/#{slug}/comments", options
|
6
14
|
end
|
15
|
+
|
7
16
|
end
|
17
|
+
|
8
18
|
end
|
9
19
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with datasources
|
5
|
+
module Datasources
|
6
|
+
|
7
|
+
# Return unique datasources correlated to a topic
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def datasources slug
|
11
|
+
get "/topics/#{slug}/datasources"
|
12
|
+
end
|
13
|
+
|
14
|
+
# Return unique datasources correlated to a topic grouped by type
|
15
|
+
#
|
16
|
+
# @param slug [String] A topic's unique identifier slug
|
17
|
+
def datasources_by_type slug
|
18
|
+
get "/topics/#{slug}/datasources/types"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
module Fizzle
|
5
|
+
|
6
|
+
# Validate a fizzle query's syntax
|
7
|
+
#
|
8
|
+
# @param options [String] :q Fizzle Query
|
9
|
+
# @note Fizzle query requires 'fizzle: ' be prepended to query
|
10
|
+
def fizzle_validate query
|
11
|
+
post "/fizzle/validate", {q: query}
|
12
|
+
end
|
13
|
+
|
14
|
+
# Test a fizzle query against a given set of comments
|
15
|
+
#
|
16
|
+
# @param query [String] :q Fizzle Query
|
17
|
+
# @param query [Array< Hash{ comment: String } >] :comments Array of comments to match against
|
18
|
+
# @note Fizzle query requires 'fizzle: ' be prepended to query
|
19
|
+
def fizzle_match query
|
20
|
+
post "/fizzle/match", query
|
21
|
+
end
|
22
|
+
|
23
|
+
# Filter a 100,000 comment sample with a fizzle query
|
24
|
+
#
|
25
|
+
# @param query [String] :q Fizzle Query
|
26
|
+
# @note Fizzle query requires 'fizzle: ' be prepended to query
|
27
|
+
def fizzle_search query
|
28
|
+
post "/fizzle/search", {q: query}
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with live search
|
5
|
+
module Live
|
6
|
+
|
7
|
+
# Query twitter data with a query string and return volume points grouped by day
|
8
|
+
#
|
9
|
+
# @param query [String] Phrase to search twitter
|
10
|
+
def twitter_volume_daily query
|
11
|
+
get "/search/twitter/volume/daily", {query: query}
|
12
|
+
end
|
13
|
+
|
14
|
+
# Query twitter data with a query string and return tweets
|
15
|
+
#
|
16
|
+
# @param query [String] Phrase to search twitter
|
17
|
+
def tweets query
|
18
|
+
get "/search/twitter", {query: query}
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with geocoded data
|
5
|
+
module Locations
|
6
|
+
|
7
|
+
# Fetch geocoded comments for a topic
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def locations slug
|
11
|
+
get "/topics/#{slug}/location/pins"
|
12
|
+
end
|
13
|
+
|
14
|
+
# Fetch average sentiment for topic broken down into provinces with counts
|
15
|
+
#
|
16
|
+
# @param slug [String] A topic's unique identifier slug
|
17
|
+
def location_sentiment slug
|
18
|
+
get "/topics/#{slug}/location/sentiment"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with a topic's reach data
|
5
|
+
module Reach
|
6
|
+
|
7
|
+
# Fetch reach counts for topic by day
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def reach_daily slug
|
11
|
+
get "/topics/#{slug}/reach/daily"
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with a topic's correlated retailers
|
5
|
+
module Retailers
|
6
|
+
|
7
|
+
# Fetch retailers correlated to a topic
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def retailers slug
|
11
|
+
get "/topics/#{slug}/retailers"
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with a topic's sentiment data
|
5
|
+
module Sentiment
|
6
|
+
|
7
|
+
# Fetch sentiment for a topic grouped by day
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def sentiment_daily slug
|
11
|
+
get "/topics/#{slug}/sentiment/daily"
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with a topic's themes
|
5
|
+
module Themes
|
6
|
+
|
7
|
+
# Return themes assigned to a topic
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def themes slug
|
11
|
+
get "/topics/#{slug}/themes"
|
12
|
+
end
|
13
|
+
|
14
|
+
# Return trend for a specific theme on a topic
|
15
|
+
#
|
16
|
+
# @param slug [String] A topic's unique identifier slug
|
17
|
+
# @param theme_id [Integer] Unique ID of theme
|
18
|
+
def themes_trend slug, theme_id
|
19
|
+
get "/topics/#{slug}/themes/trend/#{theme_id}"
|
20
|
+
end
|
21
|
+
|
22
|
+
# Return table for correlation between all themes on a topic
|
23
|
+
#
|
24
|
+
# @param slug [String] A topic's unique identifier slug
|
25
|
+
def themes_correlation slug
|
26
|
+
get "/topics/#{slug}/themes/correlation"
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
data/lib/datarank/topics.rb
CHANGED
@@ -1,9 +1,24 @@
|
|
1
1
|
module Datarank
|
2
2
|
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with topics
|
3
5
|
module Topics
|
6
|
+
|
7
|
+
# Return all topics
|
8
|
+
#
|
9
|
+
# @option options [1..1000] :limit The number of items to return.
|
4
10
|
def all_topics options={}
|
5
11
|
get '/topics', options
|
6
12
|
end
|
13
|
+
|
14
|
+
# Return single topic by slug
|
15
|
+
#
|
16
|
+
# @param slug [String] A topic's unique identifier slug
|
17
|
+
def find_topic slug
|
18
|
+
get "/topics/#{slug}"
|
19
|
+
end
|
20
|
+
|
7
21
|
end
|
22
|
+
|
8
23
|
end
|
9
24
|
end
|
data/lib/datarank/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with topics
|
5
|
+
module Volume
|
6
|
+
|
7
|
+
# Return volume for a topic grouped by day
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def volume_daily slug
|
11
|
+
get "/topics/#{slug}/volume/daily"
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with a topic's word cloud
|
5
|
+
module Wordcloud
|
6
|
+
|
7
|
+
|
8
|
+
# Return word cloud for a topic
|
9
|
+
#
|
10
|
+
# @param slug [String] A topic's unique identifier slug
|
11
|
+
def wordcloud slug
|
12
|
+
get "/topics/#{slug}/wordcloud"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Datarank do
|
4
|
+
|
5
|
+
it "returns a Datarank::Client" do
|
6
|
+
expect(Datarank.client).to be_kind_of Datarank::Client
|
7
|
+
end
|
8
|
+
|
9
|
+
# it "responds to methods on its client" do
|
10
|
+
# expect(RedditKit.respond_to?(:username)).to be true
|
11
|
+
# end
|
12
|
+
|
13
|
+
# it "forwards methods to its client" do
|
14
|
+
# expect { RedditKit.username }.not_to raise_error
|
15
|
+
# end
|
16
|
+
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require "codeclimate-test-reporter"
|
2
|
+
CodeClimate::TestReporter.start
|
3
|
+
require 'simplecov'
|
4
|
+
|
5
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[SimpleCov::Formatter::HTMLFormatter]
|
6
|
+
SimpleCov.start
|
7
|
+
|
8
|
+
# require 'dotenv'
|
9
|
+
# Dotenv.load
|
10
|
+
|
11
|
+
require 'datarank'
|
12
|
+
require 'rspec'
|
13
|
+
require 'webmock/rspec'
|
14
|
+
require 'vcr'
|
15
|
+
|
16
|
+
VCR.configure do |c|
|
17
|
+
c.configure_rspec_metadata!
|
18
|
+
|
19
|
+
c.cassette_library_dir = 'spec/cassettes'
|
20
|
+
c.hook_into :webmock
|
21
|
+
c.default_cassette_options = { :record => :new_episodes }
|
22
|
+
end
|
23
|
+
|
24
|
+
# The API key for use during testing
|
25
|
+
#
|
26
|
+
# @return The account's username.
|
27
|
+
def datarank_apikey
|
28
|
+
ENV.fetch 'DATARANK_AUTHORIZATION_KEY'
|
29
|
+
end
|
30
|
+
|
31
|
+
# The API Version for testing
|
32
|
+
#
|
33
|
+
# @return The account's username.
|
34
|
+
def datarank_api_version
|
35
|
+
ENV.fetch 'DATARANK_API_VERSION'
|
36
|
+
end
|
37
|
+
|
38
|
+
# An Datarank object
|
39
|
+
#
|
40
|
+
# @return The authenticated client.
|
41
|
+
def authenticated_client
|
42
|
+
VCR.use_cassette('authenticated_client') do
|
43
|
+
Datarank::Client.new datarank_apikey, datarank_api_version
|
44
|
+
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datarank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Addam Hardy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rspec
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.12'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.12'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: fakeweb
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.3.0
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.3.0
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: rake
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +24,6 @@ dependencies:
|
|
52
24
|
- - ">="
|
53
25
|
- !ruby/object:Gem::Version
|
54
26
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: simplecov
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.7.1
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.7.1
|
69
27
|
- !ruby/object:Gem::Dependency
|
70
28
|
name: httparty
|
71
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,7 +66,7 @@ dependencies:
|
|
108
66
|
- - ">="
|
109
67
|
- !ruby/object:Gem::Version
|
110
68
|
version: 1.2.0
|
111
|
-
description:
|
69
|
+
description: Ruby Wrapper for the DataRank REST API
|
112
70
|
email:
|
113
71
|
- addam@datarank.com
|
114
72
|
executables: []
|
@@ -116,6 +74,8 @@ extensions: []
|
|
116
74
|
extra_rdoc_files: []
|
117
75
|
files:
|
118
76
|
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
78
|
+
- ".yardopts"
|
119
79
|
- CHANGELOG.md
|
120
80
|
- Gemfile
|
121
81
|
- Gemfile.lock
|
@@ -127,9 +87,21 @@ files:
|
|
127
87
|
- lib/datarank.rb
|
128
88
|
- lib/datarank/client.rb
|
129
89
|
- lib/datarank/comments.rb
|
90
|
+
- lib/datarank/datasources.rb
|
91
|
+
- lib/datarank/fizzle.rb
|
92
|
+
- lib/datarank/live.rb
|
93
|
+
- lib/datarank/locations.rb
|
94
|
+
- lib/datarank/reach.rb
|
95
|
+
- lib/datarank/retailers.rb
|
96
|
+
- lib/datarank/sentiment.rb
|
97
|
+
- lib/datarank/themes.rb
|
130
98
|
- lib/datarank/topics.rb
|
131
99
|
- lib/datarank/version.rb
|
132
|
-
|
100
|
+
- lib/datarank/volume.rb
|
101
|
+
- lib/datarank/wordcloud.rb
|
102
|
+
- spec/datarank_spec.rb
|
103
|
+
- spec/spec_helper.rb
|
104
|
+
homepage: https://github.com/datarank/datarank-ruby
|
133
105
|
licenses: []
|
134
106
|
metadata: {}
|
135
107
|
post_install_message:
|
@@ -152,5 +124,7 @@ rubygems_version: 2.2.2
|
|
152
124
|
signing_key:
|
153
125
|
specification_version: 4
|
154
126
|
summary: '[""]'
|
155
|
-
test_files:
|
127
|
+
test_files:
|
128
|
+
- spec/datarank_spec.rb
|
129
|
+
- spec/spec_helper.rb
|
156
130
|
has_rdoc:
|