rapidapi 0.1.2 → 0.1.3
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/README.md +22 -50
- data/lib/rapidapi/version.rb +1 -1
- data/rapidapi.gemspec +5 -5
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 214c98728a2f37f58a03decc93c79b10c1ee5933
|
4
|
+
data.tar.gz: f43cfc7ba927e17911ba7e3a56fd7bfb1eb8839d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43ef83d129276e7705f91c63c546206f94065958ab940c140b6696e252b21d896b6e0a30ec82187bd00129f4c26ee721b7c3b2e02c8d38af4263214b00b3e9de
|
7
|
+
data.tar.gz: 76024835e99f38a72a35edaf5ecaf626abecd95b7e96f59060ba63516aba723189087c0a557f814649f8290282af188a71cdd11ec83bc7a6097e5a232da73a85
|
data/README.md
CHANGED
@@ -5,47 +5,39 @@
|
|
5
5
|
## Overview
|
6
6
|
RapidAPI is the world's first opensource API marketplace. It allows developers to discover and connect to the world's top APIs more easily and manage multiple API connections in one place.
|
7
7
|
|
8
|
-
##
|
9
|
-
* In case you're using
|
8
|
+
## Ruby SDK
|
9
|
+
* In case you're using gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
|
12
|
+
gem 'rapidapi', '~> 0.1.2'
|
13
13
|
```
|
14
14
|
|
15
|
-
* Otherwise, you can
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
* Otherwise, you can install the gem manually using:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem install rapidapi
|
19
|
+
```
|
19
20
|
|
20
21
|
## Initialization
|
21
22
|
Import RapidAPISDK by putting the following code in your header file
|
22
23
|
|
23
|
-
```
|
24
|
-
|
24
|
+
```ruby
|
25
|
+
require 'rapidapisdk'
|
25
26
|
```
|
26
27
|
|
27
28
|
Now initialize it using:
|
28
29
|
|
29
|
-
```
|
30
|
-
|
30
|
+
```ruby
|
31
|
+
RapidAPI.config(
|
32
|
+
project: 'PROJECT_NAME',
|
33
|
+
token: 'TOKEN'
|
34
|
+
)
|
31
35
|
```
|
32
36
|
## Usage
|
33
37
|
To use any block in the marketplace, just copy it's code snippet and paste it in your code. For example, the following is the snippet for the **Delivery.sendSMS** block:
|
34
38
|
|
35
|
-
```
|
36
|
-
|
37
|
-
withParameters:[NSDictionary dictionaryWithObjectsAndKeys:
|
38
|
-
@"Hello from RapidAPI!",@"message",
|
39
|
-
@"4158496404", @"number",
|
40
|
-
nil]
|
41
|
-
success:^(NSDictionary *responseDict) {
|
42
|
-
|
43
|
-
// response handling here ...
|
44
|
-
NSLog(@"%@",responseDict);
|
45
|
-
|
46
|
-
} failure:^(NSError *error) {
|
47
|
-
// error handling here ...
|
48
|
-
NSLog(@"%@",[error localizedDescription]);
|
39
|
+
```ruby
|
40
|
+
response = RapidAPI.call('MicrosoftEmotionAPI', 'getEmotionRecognition', { 'param1': 'xxxxx', 'param2': 'xxxx' })
|
49
41
|
```
|
50
42
|
|
51
43
|
|
@@ -57,35 +49,15 @@ Whenever a block in RapidAPI requires a file, you can either pass a URL to the f
|
|
57
49
|
#### URL
|
58
50
|
The following code will call the block MicrosoftComputerVision.analyzeImage with a URL of an image:
|
59
51
|
|
60
|
-
```
|
61
|
-
|
62
|
-
withParameters:[NSDictionary dictionaryWithObjectsAndKeys:
|
63
|
-
@"XXXXXXXXXXXXXXXXXXX",@"subscriptionKey",
|
64
|
-
@"http://example.com/file.jpg", @"image",
|
65
|
-
nil]
|
66
|
-
success:^(NSDictionary *responseDict) {
|
67
|
-
NSLog(@"%@",responseDict);
|
68
|
-
} failure:^(NSError *error) {
|
69
|
-
// error handling here ...
|
70
|
-
NSLog(@"%@",[error localizedDescription]);
|
52
|
+
```ruby
|
53
|
+
response = RapidAPI.call('MicrosoftEmotionAPI', 'getEmotionRecognition', { 'param1': 'xxxxx', 'image': 'http://image.url/' })
|
71
54
|
```
|
72
55
|
|
73
56
|
#### Post File
|
74
57
|
If the file is locally stored, you can read it using `NSFileManager` and pass the read stream to the block, like the following:
|
75
58
|
|
76
|
-
```
|
77
|
-
|
78
|
-
|
79
|
-
[rapid callPackage:@"MicrosoftComputerVision" block:@"analyzeImage"
|
80
|
-
withParameters:[NSDictionary dictionaryWithObjectsAndKeys:
|
81
|
-
@"XXXXXXXXXXXXXXXXXXX",@"subscriptionKey",
|
82
|
-
data, @"image",
|
83
|
-
nil]
|
84
|
-
success:^(NSDictionary *responseDict) {
|
85
|
-
NSLog(@"%@",responseDict);
|
86
|
-
} failure:^(NSError *error) {
|
87
|
-
// error handling here ...
|
88
|
-
NSLog(@"%@",[error localizedDescription]);
|
59
|
+
```ruby
|
60
|
+
response = RapidAPI.call('MicrosoftEmotionAPI', 'getEmotionRecognition', { 'subscriptionKey': 'xxxxxxx', 'image': UploadIO.new(File.new("Happy-man.jpg"), "image/jpg", "Happy-man.jpg") })
|
89
61
|
```
|
90
62
|
|
91
63
|
##Issues:
|
@@ -96,4 +68,4 @@ As this is a pre-release version of the SDK, you may expirience bugs. Please rep
|
|
96
68
|
|
97
69
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
98
70
|
|
99
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
71
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/rapidapi/version.rb
CHANGED
data/rapidapi.gemspec
CHANGED
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.
|
25
|
-
spec.
|
26
|
-
spec.
|
27
|
-
spec.
|
28
|
-
spec.
|
24
|
+
spec.add_dependency 'bundler', '~> 1.13'
|
25
|
+
spec.add_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_dependency 'rspec', '~> 3.0'
|
27
|
+
spec.add_dependency 'byebug', '~> 9.0', '>= 9.0.6'
|
28
|
+
spec.add_dependency 'multipart-post', '~> 2.0'
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapidapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Bukati
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.13'
|
20
|
-
type: :
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
|
-
type: :
|
34
|
+
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.0'
|
48
|
-
type: :
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: 9.0.6
|
65
|
-
type: :
|
65
|
+
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
@@ -79,7 +79,7 @@ dependencies:
|
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '2.0'
|
82
|
-
type: :
|
82
|
+
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|