CricApi 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80ee3c50b616d6210699df38377105580b46510d
4
- data.tar.gz: b76ac480ac496dc1f4dc37490e54e7e016502b0e
3
+ metadata.gz: a3ae5a83ff271e242becf50a5330da89f54cf3ad
4
+ data.tar.gz: 8a214d8ec0dd9051e4c112248f73b98289537a2d
5
5
  SHA512:
6
- metadata.gz: c04db05e16174d9346cced2280bbb574af60d6861f3e486c77f4bb11596cf2d8f28f571c0f7db114e97a037061eb17c6f6b2b558d2a795987ca6cc2825d555e4
7
- data.tar.gz: 311080451c9f68e047113bf1812fea71646d7864827a25c4a1acb03e9d7c7e047131fb853f32962e1dfeae4f575b5946845fbab05cf3b4ce83528b6aa04095b5
6
+ metadata.gz: ab5b7fea83ee96a9844b7027e78a3873237494a5ebf4cea18cc21f6aee21e944a0995c75019e7752a6190ec32e27004ddad9bba4565fcedbdb42d526657d2e89
7
+ data.tar.gz: d8faa8677d6f0a93f4b17e516c414e31d64b3164435664bfc4ba193fc4173c4e425207081f83b783e1144e6a7b3c1e668ae0b118e9d670411e16298914105c0c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- CricApi (0.2.1)
4
+ CricApi (0.2.2)
5
5
  hashie
6
6
  httparty
7
7
 
@@ -38,4 +38,4 @@ DEPENDENCIES
38
38
  rspec
39
39
 
40
40
  BUNDLED WITH
41
- 1.16.0
41
+ 1.16.2
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 7 endpoints, Usage is as Follow
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, Old Match API ####
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, Match Calender ####
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
- #### playerFinder endpoint
232
- This takes player name as input
233
-
234
- ```ruby
235
-
236
- name = "Tendulkar"
237
- cricapi.fantasySquad(name)
238
- # =>
239
- #Array of players in the format:
240
-
241
- {
242
- "data": [
243
- {
244
- "pid": 35320,
245
- "fullName": "Sachin Ramesh Tendulkar",
246
- "name": "Sachin Tendulkar"
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.
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module CricApi
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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: 2017-11-15 00:00:00.000000000 Z
11
+ date: 2018-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty