bwapi 3.0.2 → 3.1.0.pre.126
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 +13 -5
- data/README.md +31 -15
- data/bwapi.gemspec +1 -1
- data/lib/bwapi/client.rb +4 -1
- data/lib/bwapi/client/projects.rb +2 -0
- data/lib/bwapi/client/projects/facebook_queries.rb +59 -18
- data/lib/bwapi/client/projects/stream_dashboards/streams.rb +3 -1
- data/lib/bwapi/client/projects/twitter_queries.rb +85 -0
- data/lib/bwapi/configuration.rb +3 -1
- data/lib/bwapi/request.rb +16 -0
- data/lib/bwapi/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NGYxNTJmOThlMGVjN2JhMDQzNDI0NzI0OTI1YzBjZWRhNDA1MjMzMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MTU4OWNiNWFiYmEyYWUzYjAxNTVlYmZiY2Q1ZDVlZTNjNzMwNzYzMg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MjAzMTNjZDM4MmI0NGNjNmYwZTJkNmYwZDUxZmFhNjM0MDBiYTliZDAxZWFm
|
10
|
+
ZDhiMWRlMjcwNjQ4M2I4ODAwMTZiMTU1MDhkZWUyOWI1N2I2ZmM1YzU1MGFh
|
11
|
+
NDU1NTVjZjc1YmE5Zjc0Yjc2Njg1MDY4YWEwNjA3MzRlMzRjODE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2I0MTk1NWZiN2JjMmYyNDJjZTllNGMxMjFmMjFlYzNjMTRlNjBjNTY0ZjE4
|
14
|
+
ZTE0NzJlNmQxMDViMjc1YzY3Y2MyZDc1YmNmMWU5YjdmZTA4Yzg3NDhkZDBk
|
15
|
+
ZmE3ZjA3NGRlMTg4ZDQyMTA4M2MxMWE0NmFkNWI0NzBhOGEwMzI=
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[](https://bitdeli.com/free "Bitdeli Badge")
|
1
2
|
[](http://badge.fury.io/rb/bwapi)
|
2
3
|
[](https://travis-ci.org/jonathanchrisp/bwapi)
|
3
4
|
[](https://gemnasium.com/jonathanchrisp/bwapi)
|
@@ -14,48 +15,63 @@ A Ruby interface to the Brandwatch V2 API. The projects design is modelled on th
|
|
14
15
|
http://rubydoc.info/gems/bwapi/
|
15
16
|
|
16
17
|
## Getting Started
|
17
|
-
All Brandwatch API calls at present require you to be authenticated
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
bw = BWAPI::Client.new(:username => 'username@example.com', :password => 'pa$$w0rd')
|
21
|
-
```
|
22
|
-
|
23
|
-
Once you have your instance of your client you can then use a helper method to authenticate with Brandwatch:
|
18
|
+
All Brandwatch API calls at present require you to be authenticated, therefore you'll need to create an instance of a client and call login immediately:
|
24
19
|
|
25
20
|
```ruby
|
21
|
+
bw = BWAPI::Client.new(username: 'username@example.com', password: 'pa$$w0rd')
|
26
22
|
bw.login
|
27
23
|
```
|
28
|
-
|
29
|
-
The wrapper returns a boolean value to state whether you authenticated successfully.
|
30
24
|
|
31
|
-
|
25
|
+
The API returns the oauth/token response with your authentication details.
|
32
26
|
|
33
|
-
|
27
|
+
### Examples
|
34
28
|
|
35
|
-
|
29
|
+
Once authenticated, you are then able to make additional requests. The bwapi gem will automatically add your clients access token to the request header. Please see some examples of API requests below:
|
30
|
+
|
31
|
+
#### Get all projects
|
36
32
|
```ruby
|
37
33
|
bw.projects
|
38
34
|
=> #<Hashie::Mash results=[#<Hashie::Mash clientId=1856278873 clientName="JC BWAPI Demo" creationDate="2013-07-24T17:56:31.074+0000" creatorUserId=158304410 defaultIndustry="general-(recommended)" defaultLangCodes=["en"] description=nil id=1856280126 links=#<Hashie::Mash queries="http://newapi.brandwatch.com//projects/1856280126/queries.json?access_token=bd405bd7-9d1f-4c3d-ab5c-64b77791ae7f"> name="Demo Project">] resultsPage=-1 resultsPageSize=-1 resultsTotal=-1>
|
39
35
|
```
|
40
36
|
|
41
|
-
|
37
|
+
#### Get a specific project
|
42
38
|
```ruby
|
43
39
|
bw.project 1856280126
|
44
40
|
=> #<Hashie::Mash clientId=1856278873 clientName="JC BWAPI Demo" creationDate="2013-07-24T17:56:31.074+0000" creatorUserId=158304410 defaultIndustry="general-(recommended)" defaultLangCodes=["en"] description=nil id=1856280126 links=#<Hashie::Mash queries="http://newapi.brandwatch.com//projects/1856280126/queries.json?access_token=bd405bd7-9d1f-4c3d-ab5c-64b77791ae7f"> name="Demo Project">
|
45
41
|
```
|
46
42
|
|
47
|
-
|
43
|
+
#### Get a project queries summary
|
48
44
|
```ruby
|
49
45
|
bw.queries_summary 1856280126
|
50
46
|
=> #<Hashie::Mash results=[#<Hashie::Mash id=1856280351 name="LA Lakers">] resultsPage=-1 resultsPageSize=-1 resultsTotal=-1>
|
51
47
|
```
|
52
48
|
|
53
|
-
|
49
|
+
#### Get user information
|
54
50
|
```ruby
|
55
51
|
bw.me
|
56
52
|
=> #<Hashie::Mash client=#<Hashie::Mash id=1856278873 name="JC BWAPI Demo" parentId=-1 railsEnabled=false theme="brandwatch"> firstName="BWAPI" id=158304410 lastName="Demo" links=#<Hashie::Mash logout="http://newapi.brandwatch.com/logout?access_token=bd405bd7-9d1f-4c3d-ab5c-64b77791ae7f" user="http://newapi.brandwatch.com//user.json?access_token=bd405bd7-9d1f-4c3d-ab5c-64b77791ae7f"> tags=#<Hashie::Mash notify="true"> uiRole="admin" username="bwapi_demo=jonathan@brandwatch.com">
|
57
53
|
```
|
58
54
|
|
55
|
+
### Debug
|
56
|
+
In order to see the requests and responses which are being requested and returned, you can enable debug by passing this in as an option when creating your client instance:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
bw = BWAPI::Client.new(username: 'username@example.com', password: 'pa$$w0rd', debug: true)
|
60
|
+
```
|
61
|
+
|
62
|
+
Once enabled a `bwapi.log` file will be created in the current directory. Please note that you can access the log from your client also:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
bw.log.info 'logging information'
|
66
|
+
```
|
67
|
+
|
68
|
+
The above will only work if you enabled debug when creating your client.
|
69
|
+
|
70
|
+
## Contributing
|
71
|
+
If you would like to contribute to this project please fork, create your new feature and then submit a PR merging into the `staging` branch. Once the feature is merged I'll update the version number and date in the gemspec and merge to master.
|
72
|
+
|
73
|
+
Once the staging branch is merged into master a pre-release gem will automatically be created via travis. Subject to no issues being found the new version of the gem will be pushed to RubyGems.
|
74
|
+
|
59
75
|
## Tests
|
60
76
|
There are a number of unit tests which are included as part of this project, please run:
|
61
77
|
|
data/bwapi.gemspec
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'bwapi'
|
5
5
|
s.version = BWAPI::VERSION
|
6
6
|
s.version = BWAPI::VERSION + ".pre.#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
|
7
|
-
s.date = '2013-12-
|
7
|
+
s.date = '2013-12-20'
|
8
8
|
s.summary = 'Brandwatch API Wrapper'
|
9
9
|
s.description = 'A Ruby wrapper for the Brandwatch API'
|
10
10
|
s.author = 'Jonathan Chrisp'
|
data/lib/bwapi/client.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
1
3
|
require 'bwapi/authentication'
|
2
4
|
require 'bwapi/connection'
|
3
5
|
require 'bwapi/request'
|
@@ -22,9 +24,10 @@ module BWAPI
|
|
22
24
|
class Client
|
23
25
|
|
24
26
|
attr_accessor *Configuration::OPTION_KEYS
|
27
|
+
attr_reader :log
|
25
28
|
|
26
29
|
def initialize opts={}
|
27
|
-
#
|
30
|
+
@log = Logger.new("#{Dir::pwd}/bwapi.log") if opts[:debug] == true
|
28
31
|
opts = BWAPI.options.merge opts
|
29
32
|
|
30
33
|
# Create instance variables
|
@@ -2,6 +2,7 @@ require 'bwapi/client/projects/categories'
|
|
2
2
|
require 'bwapi/client/projects/data'
|
3
3
|
require 'bwapi/client/projects/data_download'
|
4
4
|
require 'bwapi/client/projects/facebook_queries'
|
5
|
+
require 'bwapi/client/projects/twitter_queries'
|
5
6
|
require 'bwapi/client/projects/signals'
|
6
7
|
require 'bwapi/client/projects/summary'
|
7
8
|
require 'bwapi/client/projects/sharing'
|
@@ -80,6 +81,7 @@ module BWAPI
|
|
80
81
|
include BWAPI::Client::Projects::Data
|
81
82
|
include BWAPI::Client::Projects::DataDownload
|
82
83
|
include BWAPI::Client::Projects::FacebookQueries
|
84
|
+
include BWAPI::Client::Projects::TwitterQueries
|
83
85
|
include BWAPI::Client::Projects::Signals
|
84
86
|
include BWAPI::Client::Projects::Summary
|
85
87
|
include BWAPI::Client::Projects::Sharing
|
@@ -4,7 +4,7 @@ module BWAPI
|
|
4
4
|
# FacebookQueries module for projects/facebookqueries endpoints
|
5
5
|
module FacebookQueries
|
6
6
|
|
7
|
-
# Get all facebook queries in project
|
7
|
+
# Get all facebook queries in a project
|
8
8
|
#
|
9
9
|
# @param project_id [Integer] Id of project
|
10
10
|
# @return [Hashie::Mash] All facebook queries in project
|
@@ -12,40 +12,81 @@ module BWAPI
|
|
12
12
|
get "projects/#{project_id}/facebookqueries"
|
13
13
|
end
|
14
14
|
|
15
|
-
# Get a specific facebook query in project
|
15
|
+
# Get a specific facebook query in a project
|
16
16
|
#
|
17
17
|
# @param project_id [Integer] Id of project
|
18
18
|
# @param query_id [Integer] Id of facebook query
|
19
19
|
# @return [Hashie::Mash] Specific facebook query
|
20
|
-
def
|
20
|
+
def get_facebook_query project_id, query_id
|
21
21
|
get "projects/#{project_id}/facebookqueries/#{query_id}"
|
22
22
|
end
|
23
|
-
alias :facebook_query :
|
23
|
+
alias :facebook_query :get_facebook_query
|
24
24
|
|
25
|
-
#
|
25
|
+
# Create a facebook query in a project
|
26
26
|
#
|
27
27
|
# @param project_id [Integer] Id of project
|
28
|
-
# @param query_id [Integer] Id of query
|
29
28
|
# @param opts [Hash] options hash of parameters
|
30
29
|
# @option opts [Integer] id Id of the query
|
30
|
+
# @option opts [String] name Name of the query
|
31
|
+
# @option opts [Boolean] authorised Is query authorised
|
32
|
+
# @option opts [Integer] averageMonthlyMentions Average monthly mentions
|
33
|
+
# @option opts [Array] contextTerms Content terms of the query
|
34
|
+
# @option opts [Array] excludedTerms Excluded terms of thequery
|
35
|
+
# @option opts [Array] includedTerms Included terms of terms query
|
36
|
+
# @option opts [Date] creationDate Date the query was created on
|
37
|
+
# @option opts [Integer] dailyLimit Daily limit of the query
|
38
|
+
# @option opts [Boolean] facebookCrawlComplete Facebook initial crawling status
|
31
39
|
# @option opts [Integer] facebookPageId Id of the facebook page
|
32
|
-
# @option opts [String] name Name of the project
|
33
40
|
# @option opts [String] facebookPageName Name of the facebook page
|
34
|
-
# @option opts [
|
35
|
-
# @option opts [
|
36
|
-
# @option opts [
|
37
|
-
# @option opts [
|
38
|
-
# @option opts [Integer] averageMonthlyMentions Average monthly mentions
|
41
|
+
# @option opts [Boolean] failed Triggered too many Facebook API request failures
|
42
|
+
# @option opts [String] industry Industry of the query
|
43
|
+
# @option opts [Array] languages Query languages set
|
44
|
+
# @option opts [Date] lastModificationDate Last modification date of the query
|
39
45
|
# @option opts [String] type Query type
|
40
|
-
# @option opts [
|
46
|
+
# @option opts [String] facebookConsumerKey Facebook consumer key
|
47
|
+
# @option opts [String] facebookAccessToken Facebook access token
|
48
|
+
# @return [Hashie::Mash] New facebook query
|
49
|
+
def create_facebook_query project_id, opts={}
|
50
|
+
post "projects/#{project_id}/facebookqueries", opts
|
51
|
+
end
|
52
|
+
|
53
|
+
# Authorise facebook queries in a project
|
54
|
+
#
|
55
|
+
# @param project_id [Integer] Id of project
|
56
|
+
# @param opts [Hash] options hash of facebook query oauth dto
|
57
|
+
# @option opts [String] accessToken Facebook access token
|
58
|
+
# @option opts [String] consumerKey Facebook consumer key
|
59
|
+
# @option opts [Array] queryIds Array of query ids
|
60
|
+
# @return [Hashie::Mash] Authorised facebook queries
|
61
|
+
def authorise_facebook_queries project_id, opts={}
|
62
|
+
post "projects/#{project_id}/facebookqueries/authorise", opts
|
63
|
+
end
|
64
|
+
|
65
|
+
# Update an existing facebook query in a project
|
66
|
+
#
|
67
|
+
# @param project_id [Integer] Id of project
|
68
|
+
# @param query_id [Integer] Id of query
|
69
|
+
# @param opts [Hash] options hash of parameters
|
70
|
+
# @option opts [Integer] id Id of the query
|
71
|
+
# @option opts [String] name Name of the query
|
72
|
+
# @option opts [Boolean] authorised Is query authorised
|
73
|
+
# @option opts [Integer] averageMonthlyMentions Average monthly mentions
|
41
74
|
# @option opts [Array] contextTerms Content terms of the query
|
42
75
|
# @option opts [Array] excludedTerms Excluded terms of thequery
|
43
|
-
# @option opts [Array]
|
44
|
-
# @option opts [String] twitterScreenName Tracked twitter screen name
|
45
|
-
# @option opts [String] industry Industry of the query
|
76
|
+
# @option opts [Array] includedTerms Included terms of terms query
|
46
77
|
# @option opts [Date] creationDate Date the query was created on
|
47
|
-
# @option opts [
|
48
|
-
# @
|
78
|
+
# @option opts [Integer] dailyLimit Daily limit of the query
|
79
|
+
# @option opts [Boolean] facebookCrawlComplete Facebook initial crawling status
|
80
|
+
# @option opts [Integer] facebookPageId Id of the facebook page
|
81
|
+
# @option opts [String] facebookPageName Name of the facebook page
|
82
|
+
# @option opts [Boolean] failed Triggered too many Facebook API request failures
|
83
|
+
# @option opts [String] industry Industry of the query
|
84
|
+
# @option opts [Array] languages Query languages set
|
85
|
+
# @option opts [Date] lastModificationDate Last modification date of the query
|
86
|
+
# @option opts [String] type Query type
|
87
|
+
# @option opts [String] facebookConsumerKey Facebook consumer key
|
88
|
+
# @option opts [String] facebookAccessToken Facebook access token
|
89
|
+
# @return [Hashie::Mash] Updated facebook query
|
49
90
|
def update_facebook_query project_id, query_id, opts={}
|
50
91
|
put "projects/#{project_id}/facebookqueries/#{query_id}", opts
|
51
92
|
end
|
@@ -35,6 +35,7 @@ module BWAPI
|
|
35
35
|
# @option opts [String] name Name of the stream
|
36
36
|
# @option opts [String] created Creation date of stream
|
37
37
|
# @option opts [String] filter Filter of the stream
|
38
|
+
# @option opts [String] settings Settings of the stream
|
38
39
|
# @option opts [String] lastModified Last modification date of stream
|
39
40
|
# @return [Hashie::Mash] Specific stream
|
40
41
|
def create_stream project_id, stream_dashboard_id, opts={}
|
@@ -51,6 +52,7 @@ module BWAPI
|
|
51
52
|
# @option opts [String] name Name of the stream
|
52
53
|
# @option opts [String] created Creation date of stream
|
53
54
|
# @option opts [String] filter Filter of the stream
|
55
|
+
# @option opts [String] settings Settings of the stream
|
54
56
|
# @option opts [String] lastModified Last modification date of stream
|
55
57
|
# @return [Hashie::Mash] Updated stream
|
56
58
|
def update_stream project_id, stream_dashboard_id, stream_id, opts={}
|
@@ -71,4 +73,4 @@ module BWAPI
|
|
71
73
|
end
|
72
74
|
end
|
73
75
|
end
|
74
|
-
end
|
76
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
module BWAPI
|
2
|
+
class Client
|
3
|
+
module Projects
|
4
|
+
# TwitterQueries module for projects/twitterqueries endpoints
|
5
|
+
module TwitterQueries
|
6
|
+
|
7
|
+
# Get all twitter queries in a project
|
8
|
+
#
|
9
|
+
# @param project_id [Integer] Id of project
|
10
|
+
# @return [Hashie::Mash] All twitter queries in project
|
11
|
+
def twitter_queries project_id
|
12
|
+
get "projects/#{project_id}/twitterqueries"
|
13
|
+
end
|
14
|
+
|
15
|
+
# Get a specific twitter query in a project
|
16
|
+
#
|
17
|
+
# @param project_id [Integer] Id of project
|
18
|
+
# @param query_id [Integer] Id of twitter query
|
19
|
+
# @return [Hashie::Mash] Specific twitter query
|
20
|
+
def get_twitter_query project_id, query_id
|
21
|
+
get "projects/#{project_id}/twitterqueries/#{query_id}"
|
22
|
+
end
|
23
|
+
alias :twitter_query :get_twitter_query
|
24
|
+
|
25
|
+
# Create a twitter query in a project
|
26
|
+
#
|
27
|
+
# @param project_id [Integer] Id of project
|
28
|
+
# @param opts [Hash] options hash of parameters
|
29
|
+
# @option opts [Integer] id Id of the query
|
30
|
+
# @option opts [String] name Name of the query
|
31
|
+
# @option opts [Boolean] authorised Is query authorised
|
32
|
+
# @option opts [Integer] averageMonthlyMentions Average monthly mentions
|
33
|
+
# @option opts [Array] contextTerms Content terms of the query
|
34
|
+
# @option opts [Array] excludedTerms Excluded terms of thequery
|
35
|
+
# @option opts [Array] includedTerms Included terms of terms query
|
36
|
+
# @option opts [Date] creationDate Date the query was created on
|
37
|
+
# @option opts [Integer] dailyLimit Daily limit of the query
|
38
|
+
# @option opts [Boolean] facebookCrawlComplete Facebook initial crawling status
|
39
|
+
# @option opts [Integer] facebookPageId Id of the facebook page
|
40
|
+
# @option opts [String] facebookPageName Name of the facebook page
|
41
|
+
# @option opts [Boolean] failed Triggered too many Facebook API request failures
|
42
|
+
# @option opts [String] industry Industry of the query
|
43
|
+
# @option opts [Array] languages Query languages set
|
44
|
+
# @option opts [Date] lastModificationDate Last modification date of the query
|
45
|
+
# @option opts [String] type Query type
|
46
|
+
# @option opts [String] twitterLimit Twitter limit
|
47
|
+
# @option opts [String] twitterScreenName Twitter screen name
|
48
|
+
# @return [Hashie::Mash] New twitter query
|
49
|
+
def create_twitter_query project_id, opts={}
|
50
|
+
post "projects/#{project_id}/twitterqueries", opts
|
51
|
+
end
|
52
|
+
|
53
|
+
# Update an existing twitter query in a project
|
54
|
+
#
|
55
|
+
# @param project_id [Integer] Id of project
|
56
|
+
# @param query_id [Integer] Id of query
|
57
|
+
# @param opts [Hash] options hash of parameters
|
58
|
+
# @option opts [Integer] id Id of the query
|
59
|
+
# @option opts [String] name Name of the query
|
60
|
+
# @option opts [Boolean] authorised Is query authorised
|
61
|
+
# @option opts [Integer] averageMonthlyMentions Average monthly mentions
|
62
|
+
# @option opts [Array] contextTerms Content terms of the query
|
63
|
+
# @option opts [Array] excludedTerms Excluded terms of thequery
|
64
|
+
# @option opts [Array] includedTerms Included terms of terms query
|
65
|
+
# @option opts [Date] creationDate Date the query was created on
|
66
|
+
# @option opts [Integer] dailyLimit Daily limit of the query
|
67
|
+
# @option opts [Boolean] facebookCrawlComplete Facebook initial crawling status
|
68
|
+
# @option opts [Integer] facebookPageId Id of the facebook page
|
69
|
+
# @option opts [String] facebookPageName Name of the facebook page
|
70
|
+
# @option opts [Boolean] failed Triggered too many Facebook API request failures
|
71
|
+
# @option opts [String] industry Industry of the query
|
72
|
+
# @option opts [Array] languages Query languages set
|
73
|
+
# @option opts [Date] lastModificationDate Last modification date of the query
|
74
|
+
# @option opts [String] type Query type
|
75
|
+
# @option opts [String] twitterLimit Twitter limit
|
76
|
+
# @option opts [String] twitterScreenName Twitter screen name
|
77
|
+
# @return [Hashie::Mash] Updated twitter query
|
78
|
+
def update_twitter_query project_id, query_id, opts={}
|
79
|
+
put "projects/#{project_id}/twitterqueries/#{query_id}", opts
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
data/lib/bwapi/configuration.rb
CHANGED
@@ -18,7 +18,8 @@ module BWAPI
|
|
18
18
|
:client_secret,
|
19
19
|
:verify_ssl,
|
20
20
|
:netrc,
|
21
|
-
:netrc_file
|
21
|
+
:netrc_file,
|
22
|
+
:debug
|
22
23
|
].freeze
|
23
24
|
|
24
25
|
DEFAULT_ADAPTER = Faraday.default_adapter
|
@@ -59,6 +60,7 @@ module BWAPI
|
|
59
60
|
self.verify_ssl = true
|
60
61
|
self.netrc = false
|
61
62
|
self.netrc_file = DEFAULT_NETRC_FILE
|
63
|
+
self.debug = false
|
62
64
|
end
|
63
65
|
end
|
64
66
|
end
|
data/lib/bwapi/request.rb
CHANGED
@@ -91,6 +91,22 @@ module BWAPI
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
+
if debug
|
95
|
+
log.info 'Connection options: %s' % conn_options
|
96
|
+
log.info 'Sending request type: %s' % method
|
97
|
+
log.info 'Request path: /%s' % path
|
98
|
+
log.info 'Request url: %s' % api_endpoint + '/' + path
|
99
|
+
log.info 'Request parameters: %s' % opts.to_json unless opts.nil?
|
100
|
+
|
101
|
+
unless response.env[:body].nil?
|
102
|
+
if response.env[:body].is_a? Hash
|
103
|
+
log.info 'Response body: %s' % response.env[:body].to_json
|
104
|
+
else
|
105
|
+
log.info 'Response body: %s' % response.env[:body]
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
94
110
|
response
|
95
111
|
end
|
96
112
|
end
|
data/lib/bwapi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bwapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.1.0.pre.126
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Chrisp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- lib/bwapi/client/projects/stream_dashboards/streams.rb
|
158
158
|
- lib/bwapi/client/projects/summary.rb
|
159
159
|
- lib/bwapi/client/projects/tags.rb
|
160
|
+
- lib/bwapi/client/projects/twitter_queries.rb
|
160
161
|
- lib/bwapi/client/projects/users.rb
|
161
162
|
- lib/bwapi/client/projects/workflow.rb
|
162
163
|
- lib/bwapi/client/query_validation.rb
|
@@ -186,17 +187,17 @@ require_paths:
|
|
186
187
|
- lib
|
187
188
|
required_ruby_version: !ruby/object:Gem::Requirement
|
188
189
|
requirements:
|
189
|
-
- - '>='
|
190
|
+
- - ! '>='
|
190
191
|
- !ruby/object:Gem::Version
|
191
192
|
version: 1.9.2
|
192
193
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
194
|
requirements:
|
194
|
-
- - '
|
195
|
+
- - ! '>'
|
195
196
|
- !ruby/object:Gem::Version
|
196
|
-
version:
|
197
|
+
version: 1.3.1
|
197
198
|
requirements: []
|
198
199
|
rubyforge_project:
|
199
|
-
rubygems_version: 2.1.
|
200
|
+
rubygems_version: 2.1.11
|
200
201
|
signing_key:
|
201
202
|
specification_version: 4
|
202
203
|
summary: Brandwatch API Wrapper
|