bwapi 6.5.0.pre.256 → 7.0.0.pre.271
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.editorconfig +11 -0
- data/.rubocop.yml +17 -0
- data/.travis.yml +7 -3
- data/bin/bwapi +2 -1
- data/bwapi.gemspec +13 -10
- data/lib/bwapi.rb +6 -6
- data/lib/bwapi/authentication.rb +9 -17
- data/lib/bwapi/client.rb +5 -4
- data/lib/bwapi/client/admin.rb +6 -6
- data/lib/bwapi/client/admin/become.rb +4 -4
- data/lib/bwapi/client/admin/search.rb +9 -12
- data/lib/bwapi/client/admin/sub_clients.rb +8 -13
- data/lib/bwapi/client/admin/users.rb +7 -7
- data/lib/bwapi/client/admin/users/sharing.rb +5 -7
- data/lib/bwapi/client/brandwatch.rb +4 -4
- data/lib/bwapi/client/brandwatch/become.rb +4 -4
- data/lib/bwapi/client/brandwatch/client_modules.rb +5 -6
- data/lib/bwapi/client/client.rb +5 -6
- data/lib/bwapi/client/command_center.rb +3 -3
- data/lib/bwapi/client/command_center/client.rb +4 -4
- data/lib/bwapi/client/command_center/displays.rb +9 -9
- data/lib/bwapi/client/command_center/displays/events.rb +8 -8
- data/lib/bwapi/client/command_center/displays/messages.rb +7 -8
- data/lib/bwapi/client/command_center/displays/scenes.rb +9 -9
- data/lib/bwapi/client/command_center/displays/screens.rb +9 -9
- data/lib/bwapi/client/command_center/displays/users.rb +7 -8
- data/lib/bwapi/client/command_center/displays/users/access.rb +4 -5
- data/lib/bwapi/client/command_center/scene_types.rb +6 -6
- data/lib/bwapi/client/command_center/themes.rb +4 -4
- data/lib/bwapi/client/command_center/users.rb +6 -6
- data/lib/bwapi/client/command_center/users/access.rb +5 -5
- data/lib/bwapi/client/error_codes.rb +4 -4
- data/lib/bwapi/client/filters.rb +4 -4
- data/lib/bwapi/client/languages.rb +3 -3
- data/lib/bwapi/client/location.rb +5 -5
- data/lib/bwapi/client/logout.rb +12 -14
- data/lib/bwapi/client/me.rb +3 -3
- data/lib/bwapi/client/metrics.rb +3 -3
- data/lib/bwapi/client/oauth.rb +8 -8
- data/lib/bwapi/client/ping.rb +8 -8
- data/lib/bwapi/client/projects.rb +10 -10
- data/lib/bwapi/client/projects/bulkactions.rb +4 -4
- data/lib/bwapi/client/projects/bulkactions/author.rb +4 -3
- data/lib/bwapi/client/projects/bulkactions/mentions.rb +4 -3
- data/lib/bwapi/client/projects/categories.rb +6 -20
- data/lib/bwapi/client/projects/data.rb +4 -5
- data/lib/bwapi/client/projects/data/mentions.rb +7 -7
- data/lib/bwapi/client/projects/data/volume.rb +11 -11
- data/lib/bwapi/client/projects/data_download.rb +6 -7
- data/lib/bwapi/client/projects/demographics.rb +3 -4
- data/lib/bwapi/client/projects/facebook_queries.rb +8 -9
- data/lib/bwapi/client/projects/group.rb +2 -2
- data/lib/bwapi/client/projects/group/author_group.rb +8 -7
- data/lib/bwapi/client/projects/group/location_group.rb +7 -7
- data/lib/bwapi/client/projects/group/site_group.rb +7 -7
- data/lib/bwapi/client/projects/queries.rb +9 -10
- data/lib/bwapi/client/projects/queries/backfill.rb +6 -8
- data/lib/bwapi/client/projects/queries/date_range.rb +9 -9
- data/lib/bwapi/client/projects/queries/mentions.rb +5 -8
- data/lib/bwapi/client/projects/query_groups.rb +7 -9
- data/lib/bwapi/client/projects/rules.rb +7 -9
- data/lib/bwapi/client/projects/rules/backfill.rb +4 -4
- data/lib/bwapi/client/projects/rules/copy.rb +4 -4
- data/lib/bwapi/client/projects/sharing.rb +8 -9
- data/lib/bwapi/client/projects/signals.rb +5 -5
- data/lib/bwapi/client/projects/stream_dashboards.rb +10 -10
- data/lib/bwapi/client/projects/stream_dashboards/streams.rb +6 -7
- data/lib/bwapi/client/projects/summary.rb +5 -6
- data/lib/bwapi/client/projects/tags.rb +8 -9
- data/lib/bwapi/client/projects/twitter_queries.rb +7 -8
- data/lib/bwapi/client/projects/users.rb +4 -4
- data/lib/bwapi/client/projects/workflow.rb +4 -4
- data/lib/bwapi/client/query_validation.rb +7 -7
- data/lib/bwapi/client/sso.rb +4 -4
- data/lib/bwapi/client/test_search.rb +9 -8
- data/lib/bwapi/client/user.rb +6 -6
- data/lib/bwapi/client/user/notifications.rb +8 -8
- data/lib/bwapi/configuration.rb +6 -6
- data/lib/bwapi/connection.rb +10 -19
- data/lib/bwapi/error.rb +43 -36
- data/lib/bwapi/request.rb +24 -27
- data/lib/bwapi/version.rb +5 -2
- data/lib/faraday/response/brandwatch_error.rb +21 -22
- data/spec/bwapi/authentication_spec.rb +7 -7
- data/spec/bwapi/client_spec.rb +17 -17
- data/spec/bwapi_spec.rb +3 -3
- data/spec/fixtures/.netrc +1 -1
- data/spec/helper.rb +4 -2
- metadata +61 -4
- data/lib/faraday/utils/utils.rb +0 -26
data/lib/bwapi/client/oauth.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
# OAuth module for oauth/token endpoint
|
4
6
|
module OAuth
|
5
|
-
|
6
7
|
# Authenticate a user
|
7
8
|
#
|
8
9
|
# @param opts [Hash] options hash of parameters
|
@@ -12,7 +13,7 @@ module BWAPI
|
|
12
13
|
# @option opts [String] client_secret Client secret
|
13
14
|
# @option opts [String] client_id Client id
|
14
15
|
# @option opts [String] force_urlencoded Force urlencoded
|
15
|
-
def oauth_token
|
16
|
+
def oauth_token(opts = {})
|
16
17
|
opts = {
|
17
18
|
username: username,
|
18
19
|
password: password,
|
@@ -24,7 +25,7 @@ module BWAPI
|
|
24
25
|
|
25
26
|
oauth_request opts
|
26
27
|
end
|
27
|
-
|
28
|
+
alias_method :login, :oauth_token
|
28
29
|
|
29
30
|
# Refresh a authenticated users oauth_token
|
30
31
|
#
|
@@ -35,7 +36,7 @@ module BWAPI
|
|
35
36
|
# @option opts [String] refresh_token Users refresh token
|
36
37
|
# @option opts [String] client_id Client id
|
37
38
|
# @option opts [String] force_urlencoded Force urlencoded
|
38
|
-
def oauth_refresh_token
|
39
|
+
def oauth_refresh_token(opts = {})
|
39
40
|
opts = {
|
40
41
|
username: username,
|
41
42
|
password: password,
|
@@ -47,7 +48,7 @@ module BWAPI
|
|
47
48
|
|
48
49
|
oauth_request opts
|
49
50
|
end
|
50
|
-
|
51
|
+
alias_method :refresh, :oauth_refresh_token
|
51
52
|
|
52
53
|
# Determines grant-type used for client
|
53
54
|
#
|
@@ -60,14 +61,13 @@ module BWAPI
|
|
60
61
|
# Sends a oauth request
|
61
62
|
#
|
62
63
|
# @param opts [Hash] options hash of parameters
|
63
|
-
def oauth_request
|
64
|
+
def oauth_request(opts = {})
|
64
65
|
creds = post 'oauth/token', opts
|
65
66
|
self.access_token = creds.access_token
|
66
67
|
self.expires_in = creds.expires_in
|
67
68
|
self.refresh_token = creds.refresh_token if application_client?
|
68
69
|
creds
|
69
70
|
end
|
70
|
-
|
71
71
|
end
|
72
72
|
end
|
73
|
-
end
|
73
|
+
end
|
data/lib/bwapi/client/ping.rb
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
# Ping module for ping endpoints
|
4
6
|
module Ping
|
5
|
-
|
6
7
|
# Get ping checking access and available HTTP verbs
|
7
8
|
#
|
8
9
|
# @return [Hashie::Mash] User id and name
|
9
10
|
def get_ping
|
10
|
-
get
|
11
|
+
get 'ping'
|
11
12
|
end
|
12
13
|
|
13
14
|
# Post ping checking access and available HTTP verbs
|
14
15
|
#
|
15
16
|
# @return [Hashie::Mash] User id and name
|
16
17
|
def create_ping
|
17
|
-
post
|
18
|
+
post 'ping'
|
18
19
|
end
|
19
20
|
|
20
21
|
# Put ping checking access and available HTTP verbs
|
21
22
|
#
|
22
23
|
# @return [Hashie::Mash] User id and name
|
23
24
|
def update_ping
|
24
|
-
put
|
25
|
+
put 'ping'
|
25
26
|
end
|
26
27
|
|
27
28
|
# Patch ping checking access and available HTTP verbs
|
28
29
|
#
|
29
30
|
# @return [Hashie::Mash] User id and name
|
30
31
|
def patch_ping
|
31
|
-
patch
|
32
|
+
patch 'ping'
|
32
33
|
end
|
33
34
|
|
34
35
|
# Delete ping checking access and available HTTP verbs
|
35
36
|
#
|
36
37
|
# @return [Hashie::Mash] User id and name
|
37
38
|
def delete_ping
|
38
|
-
delete
|
39
|
+
delete 'ping'
|
39
40
|
end
|
40
|
-
|
41
41
|
end
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'bwapi/client/projects/bulkactions'
|
2
4
|
require 'bwapi/client/projects/categories'
|
3
5
|
require 'bwapi/client/projects/data'
|
@@ -21,22 +23,21 @@ module BWAPI
|
|
21
23
|
class Client
|
22
24
|
# Projects module for projects endpoints
|
23
25
|
module Projects
|
24
|
-
|
25
26
|
# Get all projects
|
26
27
|
#
|
27
28
|
# @param opts [Hash] options hash of parameters
|
28
29
|
# @option opts [Integer] page Page of results to retrieve
|
29
30
|
# @option opts [Integer] pageSize Results per page of results
|
30
31
|
# @return [Hashie::Mash] All projects
|
31
|
-
def projects
|
32
|
-
get
|
32
|
+
def projects(opts = {})
|
33
|
+
get 'projects', opts
|
33
34
|
end
|
34
35
|
|
35
36
|
# Get a specific project
|
36
37
|
#
|
37
38
|
# @param project_id [Integer] Id of the existing project
|
38
39
|
# @return [Hashie::Mash] Specific project
|
39
|
-
def get_project
|
40
|
+
def get_project(project_id)
|
40
41
|
get "projects/#{project_id}"
|
41
42
|
end
|
42
43
|
|
@@ -52,8 +53,8 @@ module BWAPI
|
|
52
53
|
# @option opts [Date] creationDate Date the project was created on
|
53
54
|
# @option opts [Integer] creationUserId User ID of the user who created the project
|
54
55
|
# @return [Hashie::Mash] New project
|
55
|
-
def create_project
|
56
|
-
post
|
56
|
+
def create_project(opts = {})
|
57
|
+
post 'projects', opts
|
57
58
|
end
|
58
59
|
|
59
60
|
# Update an existing project
|
@@ -69,7 +70,7 @@ module BWAPI
|
|
69
70
|
# @option opts [Date] creationDate Date the project was created on
|
70
71
|
# @option opts [Integer] creationUserId User ID of the user who created the project
|
71
72
|
# @return [Hashie::Mash] Updated project
|
72
|
-
def update_project
|
73
|
+
def update_project(project_id, opts = {})
|
73
74
|
put "projects/#{project_id}", opts
|
74
75
|
end
|
75
76
|
|
@@ -77,7 +78,7 @@ module BWAPI
|
|
77
78
|
#
|
78
79
|
# @param project_id [Integer] id Id of the existing project
|
79
80
|
# @return [Hashie::Mash] Deleted project
|
80
|
-
def delete_project
|
81
|
+
def delete_project(project_id)
|
81
82
|
delete "projects/#{project_id}"
|
82
83
|
end
|
83
84
|
|
@@ -99,7 +100,6 @@ module BWAPI
|
|
99
100
|
include BWAPI::Client::Projects::Tags
|
100
101
|
include BWAPI::Client::Projects::Users
|
101
102
|
include BWAPI::Client::Projects::Workflow
|
102
|
-
|
103
103
|
end
|
104
104
|
end
|
105
|
-
end
|
105
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'bwapi/client/projects/bulkactions/mentions'
|
2
4
|
require 'bwapi/client/projects/bulkactions/author'
|
3
5
|
|
@@ -6,7 +8,6 @@ module BWAPI
|
|
6
8
|
module Projects
|
7
9
|
# BulkActions module for projects/bulkactions endpoint
|
8
10
|
module BulkActions
|
9
|
-
|
10
11
|
# Get all bulk actions in project
|
11
12
|
#
|
12
13
|
# @param project_id [Integer] Id of project
|
@@ -15,14 +16,13 @@ module BWAPI
|
|
15
16
|
# @option opts [Integer] pageSize Results per page of results
|
16
17
|
# @option opts [String] sinceDate the start date to get bulk actions from
|
17
18
|
# @return [Hashie::Mash] All bulk actions in project
|
18
|
-
def bulk_actions
|
19
|
+
def bulk_actions(project_id, opts = {})
|
19
20
|
get "projects/#{project_id}/bulkactions", opts
|
20
21
|
end
|
21
22
|
|
22
23
|
include BWAPI::Client::Projects::BulkActions::Mentions
|
23
24
|
include BWAPI::Client::Projects::BulkActions::Author
|
24
|
-
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
|
-
end
|
28
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
module Projects
|
4
6
|
module BulkActions
|
5
7
|
# Author module for projects/bulkactions/author endpoints
|
6
8
|
module Author
|
7
|
-
|
8
9
|
# Create a new bulk action in project for an author
|
9
10
|
#
|
10
11
|
# @param project_id [Integer] Id of project
|
@@ -17,11 +18,11 @@ module BWAPI
|
|
17
18
|
# @option opts [Array] interests list<String> Interests to assign
|
18
19
|
# @option opts [Array] professions list<AuthorProfessionDTO> Professions to assign
|
19
20
|
# @return [Hashie::Mash] New bulk action for mentions
|
20
|
-
def bulk_edit_author
|
21
|
+
def bulk_edit_author(project_id, opts = {})
|
21
22
|
post "projects/#{project_id}/bulkactions/author", opts
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
27
|
-
end
|
28
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
module Projects
|
4
6
|
module BulkActions
|
5
7
|
# Mentions module for projects/bulkactions/mentions endpoints
|
6
8
|
module Mentions
|
7
|
-
|
8
9
|
# Create a new bulk action in project for mentions
|
9
10
|
#
|
10
11
|
# @param project_id [Integer] Id of project
|
@@ -13,11 +14,11 @@ module BWAPI
|
|
13
14
|
# @option opts [Hash] filter <filter dto> to specify what kind of mentions this bulk action should apply to
|
14
15
|
# @option opts [Integer] sampleAmount Amount to be sample by this bulk action
|
15
16
|
# @return [Hashie::Mash] New bulk action for mentions
|
16
|
-
def bulk_edit_mentions
|
17
|
+
def bulk_edit_mentions(project_id, opts = {})
|
17
18
|
post "projects/#{project_id}/bulkactions/mentions", opts
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
23
|
-
end
|
24
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
module BWAPI
|
2
3
|
class Client
|
3
4
|
module Projects
|
4
5
|
# Categories module for projects/categories endpoints
|
5
6
|
module Categories
|
6
|
-
|
7
7
|
# Get all categories in project
|
8
8
|
#
|
9
9
|
# @param project_id [Integer] Id of project
|
@@ -11,22 +11,10 @@ module BWAPI
|
|
11
11
|
# @option opts [Integer] page Page of projects to retrieve
|
12
12
|
# @option opts [Integer] pageSize Results per page of results
|
13
13
|
# @return [Hashie::Mash] All categories in project
|
14
|
-
def categories
|
14
|
+
def categories(project_id, opts = {})
|
15
15
|
get "projects/#{project_id}/categories", opts
|
16
16
|
end
|
17
17
|
|
18
|
-
# TODO: Uncomment this code when endpoint is created
|
19
|
-
#
|
20
|
-
# Get a specific category in project
|
21
|
-
#
|
22
|
-
# @param project_id [Integer] Id of project
|
23
|
-
# @param category_id [Integer] Id of category
|
24
|
-
# @return [Hashie::Mash] Specific category
|
25
|
-
#def get_category project_id, category_id
|
26
|
-
# get "projects/#{project_id}/categories/#{category_id}", opts
|
27
|
-
#end
|
28
|
-
#alias :category :get_category
|
29
|
-
|
30
18
|
# Create a new category in project
|
31
19
|
#
|
32
20
|
# @param project_id [Integer] Id of project
|
@@ -36,7 +24,7 @@ module BWAPI
|
|
36
24
|
# @option opts [Array] children The children of the category
|
37
25
|
# @option opts [Boolean] multiple Whether multiple sub categories can be selected
|
38
26
|
# @return [Hashie::Mash] New category
|
39
|
-
def create_category
|
27
|
+
def create_category(project_id, opts = {})
|
40
28
|
post "projects/#{project_id}/categories", opts
|
41
29
|
end
|
42
30
|
|
@@ -50,21 +38,19 @@ module BWAPI
|
|
50
38
|
# @option opts [Array] children The children of the category
|
51
39
|
# @option opts [Boolean] multiple Whether multiple sub categories can be selected
|
52
40
|
# @return [Hashie::Mash] Updated category
|
53
|
-
def update_category
|
41
|
+
def update_category(project_id, category_id, opts = {})
|
54
42
|
put "projects/#{project_id}/categories/#{category_id}", opts
|
55
43
|
end
|
56
44
|
|
57
|
-
|
58
45
|
# Delete and existing category in project
|
59
46
|
#
|
60
47
|
# @param project_id [Integer] Id of project
|
61
48
|
# @param category_id [Integer] Id of query group
|
62
49
|
# @return [Hashie::Mash] Deleted category
|
63
|
-
def delete_category
|
50
|
+
def delete_category(project_id, category_id)
|
64
51
|
delete "projects/#{project_id}/categories/#{category_id}"
|
65
52
|
end
|
66
|
-
|
67
53
|
end
|
68
54
|
end
|
69
55
|
end
|
70
|
-
end
|
56
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'bwapi/client/projects/data/mentions'
|
2
3
|
require 'bwapi/client/projects/data/volume'
|
3
4
|
|
@@ -6,7 +7,6 @@ module BWAPI
|
|
6
7
|
module Projects
|
7
8
|
# Data module for projects/data endpoints
|
8
9
|
module Data
|
9
|
-
|
10
10
|
# Get all chart data for the requested dimensions
|
11
11
|
#
|
12
12
|
# @param project_id [Integer] Id of project
|
@@ -16,7 +16,7 @@ module BWAPI
|
|
16
16
|
# @param opts [Hash] options hash of parameters
|
17
17
|
# @option opts [Hash] filter The filters to apply
|
18
18
|
# @return [Hashie::Mash] All Chart data mentions
|
19
|
-
def data
|
19
|
+
def data(project_id, aggregate, dimension_one, dimension_two, opts = {})
|
20
20
|
get "projects/#{project_id}/data/#{aggregate}/#{dimension_one}/#{dimension_two}", opts
|
21
21
|
end
|
22
22
|
|
@@ -26,14 +26,13 @@ module BWAPI
|
|
26
26
|
# @param opts [Hash] options hash of parameters
|
27
27
|
# @option opts [Hash] filter The filters to apply
|
28
28
|
# @return [Hashie::Mash] Headline figures for spedified channels
|
29
|
-
def data_headlines
|
29
|
+
def data_headlines(project_id, opts = {})
|
30
30
|
get "projects/#{project_id}/data/headlines", opts
|
31
31
|
end
|
32
32
|
|
33
33
|
include BWAPI::Client::Projects::Data::Mentions
|
34
34
|
include BWAPI::Client::Projects::Data::Volume
|
35
|
-
|
36
35
|
end
|
37
36
|
end
|
38
37
|
end
|
39
|
-
end
|
38
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
module Projects
|
4
6
|
module Data
|
5
7
|
# Mentions module for projects/data/mentions endpoints
|
6
8
|
module Mentions
|
7
|
-
|
8
9
|
# Get mentions that fall within the submitted filters
|
9
10
|
#
|
10
11
|
# @param project_id [Integer] Id of project
|
@@ -16,7 +17,7 @@ module BWAPI
|
|
16
17
|
# @option opts [String] orderDirection Direction of sort
|
17
18
|
# @option opts [Integer] orderByCategory Category to sort by when orderBy category
|
18
19
|
# @return [Hashie::Mash] All Mentions
|
19
|
-
def data_mentions
|
20
|
+
def data_mentions(project_id, opts = {})
|
20
21
|
get "projects/#{project_id}/data/mentions", opts
|
21
22
|
end
|
22
23
|
|
@@ -26,7 +27,7 @@ module BWAPI
|
|
26
27
|
# @param opts [Hash] options hash of parameters
|
27
28
|
# @option opts [Hash] List The patches to be applied
|
28
29
|
# @return [Hashie::Mash] Updated mentions
|
29
|
-
def update_data_mentions
|
30
|
+
def update_data_mentions(project_id, opts = {})
|
30
31
|
patch "projects/#{project_id}/data/mentions", opts
|
31
32
|
end
|
32
33
|
|
@@ -41,7 +42,7 @@ module BWAPI
|
|
41
42
|
# @option opts [String] orderDirection Direction of sort
|
42
43
|
# @option opts [Integer] orderByCategory Category to sort by when orderBy category
|
43
44
|
# @return [Hashie::Mash] All Mentions
|
44
|
-
def data_mentions_fulltext
|
45
|
+
def data_mentions_fulltext(project_id, opts = {})
|
45
46
|
get "projects/#{project_id}/data/mentions/fulltext", opts
|
46
47
|
end
|
47
48
|
|
@@ -56,12 +57,11 @@ module BWAPI
|
|
56
57
|
# @option opts [String] orderDirection Direction of sort
|
57
58
|
# @option opts [Integer] orderByCategory Category to sort by when orderBy category
|
58
59
|
# @return [Hashie::Mash] All Mentions
|
59
|
-
def data_mentions_tweets
|
60
|
+
def data_mentions_tweets(project_id, opts = {})
|
60
61
|
get "projects/#{project_id}/data/mentions/tweets", opts
|
61
62
|
end
|
62
|
-
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
67
|
-
end
|
67
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module BWAPI
|
2
4
|
class Client
|
3
5
|
module Projects
|
4
6
|
module Data
|
5
7
|
# Volume module for projects/data/volume endpoints
|
6
8
|
module Volume
|
7
|
-
|
8
9
|
# Get all chart data for date ranges broken down by days
|
9
10
|
#
|
10
11
|
# @param project_id [Integer] Id of project
|
@@ -12,7 +13,7 @@ module BWAPI
|
|
12
13
|
# @option opts [Hash] filter The filters to apply
|
13
14
|
# @option opts [Array] dateRanges Date range ids
|
14
15
|
# @return [Hashie::Mash] All Chart data mentions
|
15
|
-
def data_volume_date_ranges_days
|
16
|
+
def data_volume_date_ranges_days(project_id, opts = {})
|
16
17
|
get "projects/#{project_id}/data/volume/dataRanges/days", opts
|
17
18
|
end
|
18
19
|
|
@@ -20,7 +21,7 @@ module BWAPI
|
|
20
21
|
#
|
21
22
|
# @param project_id [Integer] Id of project
|
22
23
|
# @option opts [Hash] filter The filters to apply
|
23
|
-
def data_volume_queries_top_sites
|
24
|
+
def data_volume_queries_top_sites(project_id, opts = {})
|
24
25
|
get "projects/#{project_id}/data/volume/queries/topsites", opts
|
25
26
|
end
|
26
27
|
|
@@ -35,7 +36,7 @@ module BWAPI
|
|
35
36
|
# @option opts [Integer] minVolume The minimum volume (number of mentions) for a topic to be returned
|
36
37
|
# @option opts [Integer] limit The limit to return
|
37
38
|
# @option opts [Integer] sampleSize The sample size
|
38
|
-
def data_volume_topics_compare
|
39
|
+
def data_volume_topics_compare(project_id, criteria, opts = {})
|
39
40
|
get "projects/#{project_id}/data/volume/topics/compare/#{criteria}", opts
|
40
41
|
end
|
41
42
|
|
@@ -46,7 +47,7 @@ module BWAPI
|
|
46
47
|
# @option opts [Integer] limit The limit to return
|
47
48
|
# @option opts [String] orderBy Parameter to sort by
|
48
49
|
# @option opts [String] orderDirection Direction of sort
|
49
|
-
def data_volume_topics_queries
|
50
|
+
def data_volume_topics_queries(project_id, opts = {})
|
50
51
|
get "projects/#{project_id}/data/volume/topics/queries", opts
|
51
52
|
end
|
52
53
|
|
@@ -57,7 +58,7 @@ module BWAPI
|
|
57
58
|
# @option opts [Integer] limit The limit to return
|
58
59
|
# @option opts [String] orderBy Parameter to sort by
|
59
60
|
# @option opts [String] orderDirection Direction of sort
|
60
|
-
def data_volume_top_authors_queries
|
61
|
+
def data_volume_top_authors_queries(project_id, opts = {})
|
61
62
|
get "projects/#{project_id}/data/volume/topauthors/queries", opts
|
62
63
|
end
|
63
64
|
|
@@ -68,7 +69,7 @@ module BWAPI
|
|
68
69
|
# @option opts [Integer] limit The limit to return
|
69
70
|
# @option opts [String] orderBy Parameter to sort by
|
70
71
|
# @option opts [String] orderDirection Direction of sort
|
71
|
-
def data_volume_top_authors_queries_alt
|
72
|
+
def data_volume_top_authors_queries_alt(project_id, opts = {})
|
72
73
|
get "projects/#{project_id}/data/volume/topauthors/queries/alt", opts
|
73
74
|
end
|
74
75
|
|
@@ -79,7 +80,7 @@ module BWAPI
|
|
79
80
|
# @option opts [Integer] limit The limit to return
|
80
81
|
# @option opts [String] orderBy Parameter to sort by
|
81
82
|
# @option opts [String] orderDirection Direction of sort
|
82
|
-
def data_volume_top_sites_queries
|
83
|
+
def data_volume_top_sites_queries(project_id, opts = {})
|
83
84
|
get "projects/#{project_id}/data/volume/topsites/queries", opts
|
84
85
|
end
|
85
86
|
|
@@ -90,12 +91,11 @@ module BWAPI
|
|
90
91
|
# @option opts [Integer] limit The limit to return
|
91
92
|
# @option opts [String] orderBy Parameter to sort by
|
92
93
|
# @option opts [String] orderDirection Direction of sort
|
93
|
-
def data_volume_top_tweeters_queries
|
94
|
+
def data_volume_top_tweeters_queries(project_id, opts = {})
|
94
95
|
get "projects/#{project_id}/data/volume/toptweeters/queries", opts
|
95
96
|
end
|
96
|
-
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
101
|
-
end
|
101
|
+
end
|