datarank 1.3.0 → 1.4.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/Gemfile.lock +7 -4
- data/datarank.gemspec +2 -2
- data/lib/datarank/client.rb +8 -0
- data/lib/datarank/comments.rb +7 -0
- data/lib/datarank/interaction.rb +45 -0
- data/lib/datarank/likes.rb +45 -0
- data/lib/datarank/locations.rb +12 -5
- data/lib/datarank/reach.rb +30 -2
- data/lib/datarank/sentiment.rb +30 -2
- data/lib/datarank/social_stats.rb +17 -0
- data/lib/datarank/themes.rb +6 -6
- data/lib/datarank/version.rb +1 -1
- data/lib/datarank/volume.rb +51 -2
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33bf78620e65947c753e631edfa8a8a29f47b31c
|
4
|
+
data.tar.gz: 191b602cf612213a474815fd20012746bce61d23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57d914a37c6d2f8c6c2be4b9fa105f4991c66af53935ce8f4e491993c725cb337fad04dc938916aad5ac9bbd163347d460f56a9f62eb2ed60e9c994b7aff76c4
|
7
|
+
data.tar.gz: 972a41dd93cf315e5927cfbab511c1097f2134fee5dc913c7c205192669150483297d5bb76799b13b560340ae6714c9162b9ea79133205f58fb88e4e3fea6580
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
datarank (1.
|
4
|
+
datarank (1.3.0)
|
5
5
|
hashie (>= 1.2.0)
|
6
6
|
httparty (>= 0.8.3)
|
7
7
|
json (>= 1.8.2)
|
@@ -39,12 +39,12 @@ GEM
|
|
39
39
|
guard-yard (2.1.4)
|
40
40
|
guard (>= 1.1.0)
|
41
41
|
yard (>= 0.7.0)
|
42
|
-
hashie (3.4.
|
42
|
+
hashie (3.4.2)
|
43
43
|
hitimes (1.2.2)
|
44
|
-
httparty (0.13.
|
44
|
+
httparty (0.13.5)
|
45
45
|
json (~> 1.8)
|
46
46
|
multi_xml (>= 0.5.2)
|
47
|
-
json (1.8.
|
47
|
+
json (1.8.3)
|
48
48
|
listen (2.9.0)
|
49
49
|
celluloid (>= 0.15.2)
|
50
50
|
rb-fsevent (>= 0.9.3)
|
@@ -112,3 +112,6 @@ DEPENDENCIES
|
|
112
112
|
vcr (~> 2.9.0)
|
113
113
|
webmock (>= 1.18.0)
|
114
114
|
yard
|
115
|
+
|
116
|
+
BUNDLED WITH
|
117
|
+
1.10.5
|
data/datarank.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'datarank/version'
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "datarank"
|
8
8
|
gem.version = Datarank::Version.to_s
|
9
|
-
gem.authors = ["Addam Hardy"]
|
9
|
+
gem.authors = ["Addam Hardy","Evan Sitzes"]
|
10
10
|
gem.email = ["addam@datarank.com"]
|
11
11
|
gem.description = "Ruby Wrapper for the DataRank REST API"
|
12
12
|
gem.summary = [""]
|
@@ -23,4 +23,4 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.add_dependency "multi_json", ">= 1.3.4"
|
24
24
|
gem.add_dependency "hashie", ">= 1.2.0"
|
25
25
|
gem.add_dependency "json", ">= 1.8.2"
|
26
|
-
end
|
26
|
+
end
|
data/lib/datarank/client.rb
CHANGED
@@ -7,6 +7,8 @@ require 'securerandom'
|
|
7
7
|
require "datarank/comments"
|
8
8
|
require "datarank/datasources"
|
9
9
|
require "datarank/fizzle"
|
10
|
+
require "datarank/interaction"
|
11
|
+
require "datarank/likes"
|
10
12
|
require "datarank/live"
|
11
13
|
require "datarank/locations"
|
12
14
|
require "datarank/reach"
|
@@ -17,6 +19,8 @@ require "datarank/topics"
|
|
17
19
|
require "datarank/volume"
|
18
20
|
require "datarank/wordcloud"
|
19
21
|
require "datarank/search"
|
22
|
+
require "datarank/social_stats"
|
23
|
+
|
20
24
|
|
21
25
|
module Datarank
|
22
26
|
class Client
|
@@ -26,6 +30,8 @@ module Datarank
|
|
26
30
|
include Datarank::Client::Comments
|
27
31
|
include Datarank::Client::Datasources
|
28
32
|
include Datarank::Client::Fizzle
|
33
|
+
include Datarank::Client::Interaction
|
34
|
+
include Datarank::Client::Likes
|
29
35
|
include Datarank::Client::Live
|
30
36
|
include Datarank::Client::Locations
|
31
37
|
include Datarank::Client::Reach
|
@@ -35,6 +41,8 @@ module Datarank
|
|
35
41
|
include Datarank::Client::Volume
|
36
42
|
include Datarank::Client::Wordcloud
|
37
43
|
include Datarank::Client::Search
|
44
|
+
include Datarank::Client::SocialStats
|
45
|
+
|
38
46
|
|
39
47
|
|
40
48
|
BASE_URI = 'https://api.datarank.com'
|
data/lib/datarank/comments.rb
CHANGED
@@ -13,6 +13,13 @@ module Datarank
|
|
13
13
|
get "/topics/#{slug}/comments", options
|
14
14
|
end
|
15
15
|
|
16
|
+
# Query interface for top 20 comments correlated to a topic by datarank score
|
17
|
+
#
|
18
|
+
# @param slug [String] A topic's unique identifier slug
|
19
|
+
def comments_top(slug, options={})
|
20
|
+
get "/topics/#{slug}/comments/top", options
|
21
|
+
end
|
22
|
+
|
16
23
|
end
|
17
24
|
|
18
25
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with a topic's interaction data
|
5
|
+
module Interaction
|
6
|
+
|
7
|
+
# Fetch interaction for a topic grouped by a time interval
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def interaction_secondly(slug, options={})
|
11
|
+
get "/topics/#{slug}/interaction/secondly", options
|
12
|
+
end
|
13
|
+
|
14
|
+
def interaction_minutely(slug, options={})
|
15
|
+
get "/topics/#{slug}/interaction/minutely", options
|
16
|
+
end
|
17
|
+
|
18
|
+
def interaction_hourly(slug, options={})
|
19
|
+
get "/topics/#{slug}/interaction/hourly", options
|
20
|
+
end
|
21
|
+
|
22
|
+
def interaction_daily(slug, options={})
|
23
|
+
get "/topics/#{slug}/interaction/daily", options
|
24
|
+
end
|
25
|
+
|
26
|
+
def interaction_weekly(slug, options={})
|
27
|
+
get "/topics/#{slug}/interaction/weekly", options
|
28
|
+
end
|
29
|
+
|
30
|
+
def interaction_monthly(slug, options={})
|
31
|
+
get "/topics/#{slug}/interaction/monthly", options
|
32
|
+
end
|
33
|
+
|
34
|
+
def interaction_quarterly(slug, options={})
|
35
|
+
get "/topics/#{slug}/interaction/quarterly", options
|
36
|
+
end
|
37
|
+
|
38
|
+
def interaction_yearly(slug, options={})
|
39
|
+
get "/topics/#{slug}/interaction/yearly", options
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with a topic's likes data
|
5
|
+
module Likes
|
6
|
+
|
7
|
+
# Fetch likes for a topic grouped by a time interval
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def likes_secondly(slug, options={})
|
11
|
+
get "/topics/#{slug}/likes/secondly", options
|
12
|
+
end
|
13
|
+
|
14
|
+
def likes_minutely(slug, options={})
|
15
|
+
get "/topics/#{slug}/likes/minutely", options
|
16
|
+
end
|
17
|
+
|
18
|
+
def likes_hourly(slug, options={})
|
19
|
+
get "/topics/#{slug}/likes/hourly", options
|
20
|
+
end
|
21
|
+
|
22
|
+
def likes_daily(slug, options={})
|
23
|
+
get "/topics/#{slug}/likes/daily", options
|
24
|
+
end
|
25
|
+
|
26
|
+
def likes_weekly(slug, options={})
|
27
|
+
get "/topics/#{slug}/likes/weekly", options
|
28
|
+
end
|
29
|
+
|
30
|
+
def likes_monthly(slug, options={})
|
31
|
+
get "/topics/#{slug}/likes/monthly", options
|
32
|
+
end
|
33
|
+
|
34
|
+
def likes_quarterly(slug, options={})
|
35
|
+
get "/topics/#{slug}/likes/quarterly", options
|
36
|
+
end
|
37
|
+
|
38
|
+
def likes_yearly(slug, options={})
|
39
|
+
get "/topics/#{slug}/likes/yearly", options
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
data/lib/datarank/locations.rb
CHANGED
@@ -4,18 +4,25 @@ module Datarank
|
|
4
4
|
# Module containing methods for interacting with geocoded data
|
5
5
|
module Locations
|
6
6
|
|
7
|
-
# Fetch
|
7
|
+
# Fetch location pins for a topic
|
8
8
|
#
|
9
9
|
# @param slug [String] A topic's unique identifier slug
|
10
|
-
def
|
10
|
+
def location_pins(slug, options={})
|
11
11
|
get "/topics/#{slug}/location/pins", options
|
12
12
|
end
|
13
13
|
|
14
|
-
# Fetch
|
14
|
+
# Fetch location provinces data for a topic
|
15
15
|
#
|
16
16
|
# @param slug [String] A topic's unique identifier slug
|
17
|
-
def
|
18
|
-
get "/topics/#{slug}/location/
|
17
|
+
def location_provinces(slug, options={})
|
18
|
+
get "/topics/#{slug}/location/provinces", options
|
19
|
+
end
|
20
|
+
|
21
|
+
# Fetch location heatmap data for a topic
|
22
|
+
#
|
23
|
+
# @param slug [String] A topic's unique identifier slug
|
24
|
+
def location_heatmap(slug, options={})
|
25
|
+
get "/topics/#{slug}/location/heatmap", options
|
19
26
|
end
|
20
27
|
|
21
28
|
end
|
data/lib/datarank/reach.rb
CHANGED
@@ -4,14 +4,42 @@ module Datarank
|
|
4
4
|
# Module containing methods for interacting with a topic's reach data
|
5
5
|
module Reach
|
6
6
|
|
7
|
-
# Fetch reach
|
7
|
+
# Fetch reach for a topic grouped by a time interval
|
8
8
|
#
|
9
9
|
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def reach_secondly(slug, options={})
|
11
|
+
get "/topics/#{slug}/reach/secondly", options
|
12
|
+
end
|
13
|
+
|
14
|
+
def reach_minutely(slug, options={})
|
15
|
+
get "/topics/#{slug}/reach/minutely", options
|
16
|
+
end
|
17
|
+
|
18
|
+
def reach_hourly(slug, options={})
|
19
|
+
get "/topics/#{slug}/reach/hourly", options
|
20
|
+
end
|
21
|
+
|
10
22
|
def reach_daily(slug, options={})
|
11
23
|
get "/topics/#{slug}/reach/daily", options
|
12
24
|
end
|
13
25
|
|
14
|
-
|
26
|
+
def reach_weekly(slug, options={})
|
27
|
+
get "/topics/#{slug}/reach/weekly", options
|
28
|
+
end
|
15
29
|
|
30
|
+
def reach_monthly(slug, options={})
|
31
|
+
get "/topics/#{slug}/reach/monthly", options
|
32
|
+
end
|
33
|
+
|
34
|
+
def reach_quarterly(slug, options={})
|
35
|
+
get "/topics/#{slug}/reach/quarterly", options
|
36
|
+
end
|
37
|
+
|
38
|
+
def reach_yearly(slug, options={})
|
39
|
+
get "/topics/#{slug}/reach/yearly", options
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
16
44
|
end
|
17
45
|
end
|
data/lib/datarank/sentiment.rb
CHANGED
@@ -4,14 +4,42 @@ module Datarank
|
|
4
4
|
# Module containing methods for interacting with a topic's sentiment data
|
5
5
|
module Sentiment
|
6
6
|
|
7
|
-
# Fetch sentiment for a topic grouped by
|
7
|
+
# Fetch sentiment for a topic grouped by a time interval
|
8
8
|
#
|
9
9
|
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def sentiment_secondly(slug, options={})
|
11
|
+
get "/topics/#{slug}/sentiment/secondly", options
|
12
|
+
end
|
13
|
+
|
14
|
+
def sentiment_minutely(slug, options={})
|
15
|
+
get "/topics/#{slug}/sentiment/minutely", options
|
16
|
+
end
|
17
|
+
|
18
|
+
def sentiment_hourly(slug, options={})
|
19
|
+
get "/topics/#{slug}/sentiment/hourly", options
|
20
|
+
end
|
21
|
+
|
10
22
|
def sentiment_daily(slug, options={})
|
11
23
|
get "/topics/#{slug}/sentiment/daily", options
|
12
24
|
end
|
13
25
|
|
14
|
-
|
26
|
+
def sentiment_weekly(slug, options={})
|
27
|
+
get "/topics/#{slug}/sentiment/weekly", options
|
28
|
+
end
|
15
29
|
|
30
|
+
def sentiment_monthly(slug, options={})
|
31
|
+
get "/topics/#{slug}/sentiment/monthly", options
|
32
|
+
end
|
33
|
+
|
34
|
+
def sentiment_quarterly(slug, options={})
|
35
|
+
get "/topics/#{slug}/sentiment/quarterly", options
|
36
|
+
end
|
37
|
+
|
38
|
+
def sentiment_yearly(slug, options={})
|
39
|
+
get "/topics/#{slug}/sentiment/yearly", options
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
16
44
|
end
|
17
45
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Datarank
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Module containing methods for interacting with a topic's social stats
|
5
|
+
module SocialStats
|
6
|
+
|
7
|
+
# Fetch social stats correlated to a topic
|
8
|
+
#
|
9
|
+
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def social_stats(slug, options={})
|
11
|
+
get "/topics/#{slug}/social/stats", options
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
data/lib/datarank/themes.rb
CHANGED
@@ -7,23 +7,23 @@ module Datarank
|
|
7
7
|
# Return themes assigned to a topic
|
8
8
|
#
|
9
9
|
# @param slug [String] A topic's unique identifier slug
|
10
|
-
def themes
|
11
|
-
get "/topics/#{slug}/themes"
|
10
|
+
def themes(slug, options={})
|
11
|
+
get "/topics/#{slug}/themes", options
|
12
12
|
end
|
13
13
|
|
14
14
|
# Return trend for a specific theme on a topic
|
15
15
|
#
|
16
16
|
# @param slug [String] A topic's unique identifier slug
|
17
17
|
# @param theme_id [Integer] Unique ID of theme
|
18
|
-
def themes_trend
|
19
|
-
get "/topics/#{slug}/themes/trend/#{theme_id}"
|
18
|
+
def themes_trend(slug, theme_id, options={})
|
19
|
+
get "/topics/#{slug}/themes/trend/#{theme_id}", options
|
20
20
|
end
|
21
21
|
|
22
22
|
# Return table for correlation between all themes on a topic
|
23
23
|
#
|
24
24
|
# @param slug [String] A topic's unique identifier slug
|
25
|
-
def themes_correlation
|
26
|
-
get "/topics/#{slug}/themes/correlation"
|
25
|
+
def themes_correlation(slug, options={})
|
26
|
+
get "/topics/#{slug}/themes/correlation", options
|
27
27
|
end
|
28
28
|
|
29
29
|
end
|
data/lib/datarank/version.rb
CHANGED
data/lib/datarank/volume.rb
CHANGED
@@ -4,13 +4,62 @@ module Datarank
|
|
4
4
|
# Module containing methods for interacting with topics
|
5
5
|
module Volume
|
6
6
|
|
7
|
-
# Return volume for a topic grouped by
|
8
|
-
#
|
7
|
+
# Return volume for a topic grouped by a time interval
|
8
|
+
#
|
9
9
|
# @param slug [String] A topic's unique identifier slug
|
10
|
+
def volume_secondly(slug, options={})
|
11
|
+
get "/topics/#{slug}/volume/secondly", options
|
12
|
+
end
|
13
|
+
|
14
|
+
def volume_minutely(slug, options={})
|
15
|
+
get "/topics/#{slug}/volume/minutely", options
|
16
|
+
end
|
17
|
+
|
18
|
+
def volume_hourly(slug, options={})
|
19
|
+
get "/topics/#{slug}/volume/hourly", options
|
20
|
+
end
|
21
|
+
|
10
22
|
def volume_daily(slug, options={})
|
11
23
|
get "/topics/#{slug}/volume/daily", options
|
12
24
|
end
|
13
25
|
|
26
|
+
def volume_weekly(slug, options={})
|
27
|
+
get "/topics/#{slug}/volume/weekly", options
|
28
|
+
end
|
29
|
+
|
30
|
+
def volume_monthly(slug, options={})
|
31
|
+
get "/topics/#{slug}/volume/monthly", options
|
32
|
+
end
|
33
|
+
|
34
|
+
def volume_quarterly(slug, options={})
|
35
|
+
get "/topics/#{slug}/volume/quarterly", options
|
36
|
+
end
|
37
|
+
|
38
|
+
def volume_yearly(slug, options={})
|
39
|
+
get "/topics/#{slug}/volume/yearly", options
|
40
|
+
end
|
41
|
+
|
42
|
+
# Return hourly average volume for a topic
|
43
|
+
#
|
44
|
+
# @param slug [String] A topic's unique identifier slug
|
45
|
+
def volume_hourly_average(slug, options={})
|
46
|
+
get "/topics/#{slug}/volume/hourly/average", options
|
47
|
+
end
|
48
|
+
|
49
|
+
# Return day-of-week volume for a topic
|
50
|
+
#
|
51
|
+
# @param slug [String] A topic's unique identifier slug
|
52
|
+
def volume_weekday(slug, options={})
|
53
|
+
get "/topics/#{slug}/volume/weekday", options
|
54
|
+
end
|
55
|
+
|
56
|
+
# Return hourly day-of-week heatmap information for a topic
|
57
|
+
#
|
58
|
+
# @param slug [String] A topic's unique identifier slug
|
59
|
+
def volume_weekday_heatmap_hourly(slug, options={})
|
60
|
+
get "/topics/#{slug}/volume/weekday/heatmap/hourly", options
|
61
|
+
end
|
62
|
+
|
14
63
|
end
|
15
64
|
|
16
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datarank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Addam Hardy
|
8
|
+
- Evan Sitzes
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2015-
|
12
|
+
date: 2015-09-08 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rake
|
@@ -103,12 +104,15 @@ files:
|
|
103
104
|
- lib/datarank/comments.rb
|
104
105
|
- lib/datarank/datasources.rb
|
105
106
|
- lib/datarank/fizzle.rb
|
107
|
+
- lib/datarank/interaction.rb
|
108
|
+
- lib/datarank/likes.rb
|
106
109
|
- lib/datarank/live.rb
|
107
110
|
- lib/datarank/locations.rb
|
108
111
|
- lib/datarank/reach.rb
|
109
112
|
- lib/datarank/retailers.rb
|
110
113
|
- lib/datarank/search.rb
|
111
114
|
- lib/datarank/sentiment.rb
|
115
|
+
- lib/datarank/social_stats.rb
|
112
116
|
- lib/datarank/themes.rb
|
113
117
|
- lib/datarank/topics.rb
|
114
118
|
- lib/datarank/version.rb
|