CricApi 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +60 -29
- data/lib/CricApi.rb +8 -1
- data/lib/CricApi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3ae5a83ff271e242becf50a5330da89f54cf3ad
|
4
|
+
data.tar.gz: 8a214d8ec0dd9051e4c112248f73b98289537a2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab5b7fea83ee96a9844b7027e78a3873237494a5ebf4cea18cc21f6aee21e944a0995c75019e7752a6190ec32e27004ddad9bba4565fcedbdb42d526657d2e89
|
7
|
+
data.tar.gz: d8faa8677d6f0a93f4b17e516c414e31d64b3164435664bfc4ba193fc4173c4e425207081f83b783e1144e6a7b3c1e668ae0b118e9d670411e16298914105c0c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -25,7 +25,7 @@ The [CricApi](http://www.cricapi.com/), Free to use, super-high bandwidth, high
|
|
25
25
|
|
26
26
|
In order to use the [CricApi](http://www.cricapi.com/) endpoints, u need to have an api_key which can use generated by signing into [cricapi](http://www.cricapi.com/). For testing purpose can use test_api_key "TESTKEY0273"
|
27
27
|
|
28
|
-
There are
|
28
|
+
There are 8 endpoints, Usage is as Follow
|
29
29
|
|
30
30
|
```ruby
|
31
31
|
require 'CricApi'
|
@@ -33,7 +33,7 @@ There are 7 endpoints, Usage is as Follow
|
|
33
33
|
api_key = "TESTKEY0273"
|
34
34
|
cricapi = CricApi::Request.new(api_key)
|
35
35
|
```
|
36
|
-
#### cricket endpoint
|
36
|
+
#### cricket endpoint
|
37
37
|
|
38
38
|
```ruby
|
39
39
|
|
@@ -51,7 +51,7 @@ There are 7 endpoints, Usage is as Follow
|
|
51
51
|
]
|
52
52
|
}
|
53
53
|
```
|
54
|
-
#### schedule endpoint
|
54
|
+
#### schedule endpoint
|
55
55
|
|
56
56
|
```ruby
|
57
57
|
|
@@ -72,7 +72,7 @@ There are 7 endpoints, Usage is as Follow
|
|
72
72
|
}
|
73
73
|
```
|
74
74
|
|
75
|
-
#### cricketScore endpoint
|
75
|
+
#### cricketScore endpoint
|
76
76
|
This requires a match unique_id, which will be provide by cricket endpoint
|
77
77
|
|
78
78
|
```ruby
|
@@ -94,7 +94,7 @@ This requires a match unique_id, which will be provide by cricket endpoint
|
|
94
94
|
}
|
95
95
|
```
|
96
96
|
|
97
|
-
#### matches endpoint
|
97
|
+
#### matches endpoint
|
98
98
|
|
99
99
|
```ruby
|
100
100
|
cricapi.matches
|
@@ -115,7 +115,7 @@ This requires a match unique_id, which will be provide by cricket endpoint
|
|
115
115
|
}
|
116
116
|
```
|
117
117
|
|
118
|
-
#### playerStats endpoint
|
118
|
+
#### playerStats endpoint
|
119
119
|
This requires a players pid, which will be obtained [here](http://www.cricapi.com/players/)
|
120
120
|
|
121
121
|
```ruby
|
@@ -137,11 +137,34 @@ This requires a players pid, which will be obtained [here](http://www.cricapi.co
|
|
137
137
|
"playingRole": "Top-order batsman"
|
138
138
|
}
|
139
139
|
|
140
|
+
```
|
141
|
+
|
142
|
+
#### playerFinder endpoint
|
143
|
+
This takes player name as input
|
144
|
+
|
145
|
+
```ruby
|
146
|
+
|
147
|
+
name = "Tendulkar"
|
148
|
+
cricapi.fantasySquad(name)
|
149
|
+
# =>
|
150
|
+
#Array of players in the format:
|
151
|
+
|
152
|
+
{
|
153
|
+
"data": [
|
154
|
+
{
|
155
|
+
"pid": 35320,
|
156
|
+
"fullName": "Sachin Ramesh Tendulkar",
|
157
|
+
"name": "Sachin Tendulkar"
|
158
|
+
}
|
159
|
+
]
|
160
|
+
}
|
161
|
+
|
162
|
+
|
140
163
|
```
|
141
164
|
|
142
165
|
The remaining 2 are Fantasy API endpoints, Fantasy API are billable since they're designed to help you generate income by running Fantasy Cricket portals. Each hit is 1 credit. You get 250 credits free. Deducted from your prepaid account.
|
143
166
|
|
144
|
-
#### fantasySummary endpoint
|
167
|
+
#### fantasySummary endpoint
|
145
168
|
This requires a match unique_id, which will be provide by cricket endpoint
|
146
169
|
|
147
170
|
```ruby
|
@@ -228,30 +251,38 @@ This requires a match unique_id, which will be provide by cricket endpoint
|
|
228
251
|
|
229
252
|
```
|
230
253
|
|
231
|
-
####
|
232
|
-
This
|
233
|
-
|
234
|
-
```ruby
|
235
|
-
|
236
|
-
|
237
|
-
cricapi.fantasySquad(
|
238
|
-
# =>
|
239
|
-
#Array of
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
254
|
+
#### fantasySquad endpoint
|
255
|
+
This requires a match unique_id, which will be provide by cricket endpoint
|
256
|
+
|
257
|
+
```ruby
|
258
|
+
|
259
|
+
unique_id = "1034809"
|
260
|
+
cricapi.fantasySquad(unique_id)
|
261
|
+
# =>
|
262
|
+
#Array of Squad entries in the format:
|
263
|
+
{
|
264
|
+
"squad": [
|
265
|
+
{
|
266
|
+
"name": "Ireland Women",
|
267
|
+
"players": [
|
268
|
+
{
|
269
|
+
"pid": 1150585,
|
270
|
+
"name": "Orla Prendergast"
|
271
|
+
},
|
272
|
+
{
|
273
|
+
"pid": 418420,
|
274
|
+
"name": "Laura Delany"
|
275
|
+
},
|
276
|
+
{
|
277
|
+
"pid": 418423,
|
278
|
+
"name": "Kim Garth"
|
279
|
+
}
|
280
|
+
}
|
281
|
+
]
|
282
|
+
}
|
283
|
+
|
252
284
|
```
|
253
285
|
|
254
|
-
|
255
286
|
## Development
|
256
287
|
|
257
288
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/CricApi.rb
CHANGED
@@ -49,7 +49,14 @@ module CricApi
|
|
49
49
|
summary = clean_response(response)
|
50
50
|
summary
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
|
+
def fantasySquad(unique_id)
|
54
|
+
@options[:query][:unique_id] = unique_id
|
55
|
+
response = self.class.post("/api/fantasySquad", @options)
|
56
|
+
squad = clean_response(response)
|
57
|
+
squad
|
58
|
+
end
|
59
|
+
|
53
60
|
def playerFinder(name)
|
54
61
|
@options[:query][:name] = name
|
55
62
|
response = self.class.post("/api/playerFinder", @options)
|
data/lib/CricApi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CricApi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kgangadhar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|