bwapi 9.0.0.pre.364 → 9.0.0.pre.365
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +20 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Njc4YjUwZTIyNWQzMDFlMDQzMTE3MjQ1MmY1MDk2MTA0ZDgzNTFkOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDRhNzU0ZmNiNjc4ODNmZDQxM2Q0NTlhZmJmNWYxOThkMTJkNzdlOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTNmY2Q0NDQ5YzM2ZjU5NTEwOTVjNTFlYjkyMWEyNzEyMDg4ZWYwNzgxMjEy
|
10
|
+
M2ExMTc1MTVjYmZiMTllZWY1OWYzZDIwMGU3ZmQ0NDJiY2FiNDZkN2UxOWFi
|
11
|
+
NzM2ZTVlYjA4MTkzY2QzZWFhOWRhNDY1ZDU5OWM2ZDM1N2RhZDY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzkwYmIzYmY0NGM4NWI1MzQ4YzY5YmY2Yzc0ZGM4OWY2OTMxMmE2N2NlODMy
|
14
|
+
NmYzMzU4ZTVmNTY2N2M2Yjk4NTJlOGNhMDRkNjFiNjg5OGY2YWY2YjkwODZk
|
15
|
+
OGVmMDEzNGNhMWRhZDkwZDQyNTkwMmZiMGRkMDRkNTllNDk0MWM=
|
data/README.md
CHANGED
@@ -23,48 +23,58 @@ bw.login
|
|
23
23
|
|
24
24
|
The API returns the oauth/token response with your authentication details.
|
25
25
|
|
26
|
-
|
26
|
+
## Examples
|
27
27
|
|
28
28
|
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:
|
29
29
|
|
30
|
-
|
30
|
+
### Request all projects
|
31
31
|
```ruby
|
32
32
|
bw.projects
|
33
33
|
=> #<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>
|
34
34
|
```
|
35
35
|
|
36
|
-
|
36
|
+
### Request a specific project
|
37
37
|
```ruby
|
38
38
|
bw.project 1856280126
|
39
39
|
=> #<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">
|
40
40
|
```
|
41
41
|
|
42
|
-
|
42
|
+
### Request a project queries summary
|
43
43
|
```ruby
|
44
44
|
bw.queries_summary 1856280126
|
45
45
|
=> #<Hashie::Mash results=[#<Hashie::Mash id=1856280351 name="LA Lakers">] resultsPage=-1 resultsPageSize=-1 resultsTotal=-1>
|
46
46
|
```
|
47
47
|
|
48
|
-
|
48
|
+
### Request user information
|
49
49
|
```ruby
|
50
50
|
bw.me
|
51
51
|
=> #<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">
|
52
52
|
```
|
53
53
|
|
54
|
-
|
55
|
-
|
54
|
+
## Debug Mode
|
55
|
+
|
56
|
+
In order to see additional logging and performance information you can enable debug mode by passing this in as an option when creating your client instance:
|
56
57
|
|
57
58
|
```ruby
|
58
59
|
bw = BWAPI::Client.new(username: 'username@example.com', password: 'pa$$w0rd', debug: true)
|
59
60
|
```
|
60
61
|
|
61
|
-
|
62
|
+
### Logging
|
63
|
+
|
64
|
+
Any log output will be written to STDOUT unless you define a logger:
|
62
65
|
|
63
66
|
```ruby
|
64
|
-
bw.
|
67
|
+
bw = BWAPI::Client.new(username: 'username@example.com', password: 'pa$$w0rd', debug: true, log: Logger.new('main.log'))
|
65
68
|
```
|
66
69
|
|
67
|
-
|
70
|
+
### Performance
|
71
|
+
|
72
|
+
When debug mode is running each request/response is timed and stored, to view the stats call the performance method on the client instance:
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
bw.performance
|
76
|
+
{"post_oauth_token"=>[0.125019], "get_me"=> [0.048003, 0.034587, 0.038165, 0.10304]}
|
77
|
+
```
|
68
78
|
|
69
79
|
## Contributing
|
70
80
|
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.
|