PageRenderTime 89ms CodeModel.GetById 11ms app.highlight 71ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/DDG/Spice/ESPN/Basketball.pm

https://github.com/robertbrook/zeroclickinfo-spice
Perl | 700 lines | 697 code | 3 blank | 0 comment | 1 complexity | 4e245bcbb412e8f1fea7677eaefb7748 MD5 | raw file
  1package DDG::Spice::ESPN::Basketball;
  2
  3use DDG::Spice;
  4use Time::localtime;
  5
  6description "News and stats for basketball players";
  7name "ESPN Basketball";
  8primary_example_queries "Dwyane Wade", "Kobe Bryant";
  9topics "entertainment", "special_interest";
 10category "reference";
 11code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/ESPN/Basketball.pm";
 12attribution web => ['http://duckduckgo.com', 'DuckDuckGo'],
 13            twitter => ['http://twitter.com/duckduckgo', 'duckduckgo'];
 14
 15my %leagues = (
 16    nba => {
 17        "alex abrines" => 2995702,
 18        "quincy acy" => 6576,
 19        "steven adams" => 2991235,
 20        "jeff adrien" => 4335,
 21        "arron afflalo" => 3187,
 22        "ronnie aguilar" => 6655,
 23        "blake ahearn" => 3402,
 24        "josh akognon" => 6656,
 25        "solomon alabi" => 4268,
 26        "furkan aldemir" => 6577,
 27        "cole aldrich" => 4267,
 28        "lamarcus aldridge" => 2983,
 29        "lavoy allen" => 6424,
 30        "ray allen" => 9,
 31        "ryan allen" => 6660,
 32        "tony allen" => 2367,
 33        "al-farouq aminu" => 4248,
 34        "lou amundson" => 3041,
 35        "chris andersen" => 1135,
 36        "alan anderson" => 6569,
 37        "james anderson" => 4242,
 38        "kevin anderson" => 2282360,
 39        "ryan anderson" => 3412,
 40        "giannis antetokounmpo" => 3032977,
 41        "carmelo anthony" => 1975,
 42        "joel anthony" => 3247,
 43        "pero antic" => 2585616,
 44        "trevor ariza" => 2426,
 45        "darrell arthur" => 3413,
 46        "omer asik" => 3414,
 47        "d.j. augustin" => 3415,
 48        "gustavo ayon" => 6546,
 49        "jeff ayres" => 4008,
 50        "kelenna azubuike" => 2821,
 51        "luke babbitt" => 4250,
 52        "leandro barbosa" => 2166,
 53        "j.j. barea" => 3055,
 54        "andrea bargnani" => 2987,
 55        "harrison barnes" => 6578,
 56        "matt barnes" => 1765,
 57        "earl barron" => 2477,
 58        "will barton" => 6579,
 59        "brandon bass" => 2745,
 60        "shane battier" => 976,
 61        "nicolas batum" => 3416,
 62        "jerryd bayless" => 3417,
 63        "aron baynes" => 2968439,
 64        "kent bazemore" => 6637,
 65        "bradley beal" => 6580,
 66        "michael beasley" => 3418,
 67        "rodrigue beaubois" => 3963,
 68        "marco belinelli" => 3190,
 69        "oscar bellfield" => 6645,
 70        "anthony bennett" => 2991473,
 71        "keith benson" => 6425,
 72        "patrick beverley" => 3964,
 73        "andris biedrins" => 2427,
 74        "chauncey billups" => 63,
 75        "bismack biyombo" => 6427,
 76        "dejuan blair" => 3965,
 77        "steve blake" => 1994,
 78        "marqus blakely" => 4323,
 79        "andray blatche" => 2746,
 80        "eric bledsoe" => 4238,
 81        "eric boateng" => 4308,
 82        "keith bogans" => 1995,
 83        "andrew bogut" => 2747,
 84        "matt bonner" => 1996,
 85        "trevor booker" => 4270,
 86        "carlos boozer" => 1703,
 87        "chris bosh" => 1977,
 88        "avery bradley" => 4240,
 89        "elton brand" => 91,
 90        "corey brewer" => 3191,
 91        "ronnie brewer" => 2991,
 92        "aaron brooks" => 3192,
 93        "marshon brooks" => 6428,
 94        "carlon brown" => 6650,
 95        "derrick brown" => 3967,
 96        "kwame brown" => 981,
 97        "lorenzo brown" => 2528787,
 98        "shannon brown" => 2992,
 99        "kobe bryant" => 110,
100        "chase budinger" => 3968,
101        "reggie bullock" => 2528779,
102        "trey burke" => 2579260,
103        "alec burks" => 6429,
104        "brian butch" => 4234,
105        "caron butler" => 1705,
106        "jimmy butler" => 6430,
107        "dwight buycks" => 6503,
108        "andrew bynum" => 2748,
109        "will bynum" => 2816,
110        "nick calathes" => 3969,
111        "jose calderon" => 2806,
112        "kentavious caldwell-pope" => 2581018,
113        "marcus camby" => 125,
114        "isaiah canaan" => 2490589,
115        "rodney carney" => 2995,
116        "demarre carroll" => 3970,
117        "matt carroll" => 2211,
118        "anthony carter" => 137,
119        "vince carter" => 136,
120        "michael carter-williams" => 2596108,
121        "omri casspi" => 3554,
122        "mario chalmers" => 3419,
123        "tyson chandler" => 984,
124        "wilson chandler" => 3194,
125        "josh childress" => 2373,
126        "dionte christmas" => 4025,
127        "earl clark" => 3971,
128        "ian clark" => 2489785,
129        "victor claver" => 3972,
130        "norris cole" => 6431,
131        "jason collins" => 987,
132        "darren collison" => 3973,
133        "nick collison" => 1978,
134        "mike conley" => 3195,
135        "will conroy" => 2827,
136        "brian cook" => 1998,
137        "daequan cook" => 3196,
138        "chris copeland" => 6635,
139        "demarcus cousins" => 4258,
140        "robert covington" => 2490620,
141        "allen crabbe" => 2531210,
142        "jamal crawford" => 165,
143        "jordan crawford" => 4243,
144        "jae crowder" => 6581,
145        "dante cunningham" => 3974,
146        "jared cunningham" => 6582,
147        "eddy curry" => 990,
148        "seth curry" => 2326307,
149        "stephen curry" => 3975,
150        "samuel dalembert" => 991,
151        "marquis daniels" => 2200,
152        "luigi datome" => 2585629,
153        "anthony davis" => 6583,
154        "ed davis" => 4259,
155        "glen davis" => 3200,
156        "austin daye" => 3976,
157        "nando de colo" => 3977,
158        "dewayne dedmon" => 2580913,
159        "carlos delfino" => 1999,
160        "luol deng" => 2429,
161        "stephen dennis" => 4326,
162        "justin dentmon" => 6483,
163        "demar derozan" => 3978,
164        "boris diaw" => 2167,
165        "gorgui dieng" => 2534781,
166        "ike diogu" => 2750,
167        "desagana diop" => 992,
168        "keyon dooling" => 209,
169        "toney douglas" => 3979,
170        "chris douglas-roberts" => 3422,
171        "micah downs" => 2202074,
172        "robert dozier" => 3980,
173        "goran dragic" => 3423,
174        "larry drew ii" => 2325495,
175        "andre drummond" => 6585,
176        "bojan dubljevic" => 3032985,
177        "jared dudley" => 3201,
178        "chris duhon" => 2377,
179        "tim duncan" => 215,
180        "michael dunigan" => 6662,
181        "mike dunleavy" => 1708,
182        "ronald dupree" => 2214,
183        "kevin durant" => 3202,
184        "devin ebanks" => 4256,
185        "wayne ellington" => 3981,
186        "monta ellis" => 2751,
187        "andre emmett" => 2431,
188        "kim english" => 6586,
189        "james ennis" => 2579321,
190        "micheal eric" => 6640,
191        "jeremy evans" => 4295,
192        "reggie evans" => 1828,
193        "tyreke evans" => 3983,
194        "festus ezeli" => 6587,
195        "kenneth faried" => 6433,
196        "jordan farmar" => 3002,
197        "mustapha farrakhan" => 2282197,
198        "vitor faverani" => 3046453,
199        "derrick favors" => 4257,
200        "carrick felix" => 2531185,
201        "raymond felton" => 2753,
202        "kyrylo fesenko" => 3205,
203        "landry fields" => 4274,
204        "derek fisher" => 246,
205        "jonny flynn" => 3985,
206        "kyle fogg" => 6651,
207        "gary forbes" => 4312,
208        "evan fournier" => 6588,
209        "randy foye" => 3003,
210        "jamaal franklin" => 2528356,
211        "jimmer fredette" => 6434,
212        "joel freeland" => 3004,
213        "channing frye" => 2754,
214        "sundiata gaines" => 4224,
215        "danilo gallinari" => 3428,
216        "francisco garcia" => 2755,
217        "kevin garnett" => 261,
218        "diante garrett" => 6663,
219        "marc gasol" => 3206,
220        "pau gasol" => 996,
221        "rudy gay" => 3005,
222        "alonzo gee" => 4232,
223        "mickael gelabale" => 2756,
224        "paul george" => 4251,
225        "daniel gibson" => 3006,
226        "taj gibson" => 3986,
227        "trey gilder" => 4021,
228        "eddie gill" => 270,
229        "manu ginobili" => 272,
230        "mickell gladness" => 4329,
231        "rudy gobert" => 3032976,
232        "ryan gomes" => 2757,
233        "drew gooden" => 1711,
234        "archie goodwin" => 2991281,
235        "ben gordon" => 2381,
236        "eric gordon" => 3431,
237        "marcin gortat" => 2758,
238        "andrew goudelock" => 6435,
239        "lance goulbourne" => 6652,
240        "danny granger" => 2760,
241        "aaron gray" => 3207,
242        "steven gray" => 6649,
243        "danny green" => 3988,
244        "draymond green" => 6589,
245        "gerald green" => 2761,
246        "jeff green" => 3209,
247        "willie green" => 2004,
248        "orien greene" => 2762,
249        "blake griffin" => 3989,
250        "eric griffin" => 2528646,
251        "hamed haddadi" => 3478,
252        "jordan hamilton" => 6436,
253        "justin hamilton" => 6590,
254        "richard hamilton" => 294,
255        "ben hansbrough" => 6657,
256        "tyler hansbrough" => 3991,
257        "luke harangody" => 4276,
258        "tim hardaway jr." => 2528210,
259        "james harden" => 3992,
260        "james harden" => 3992,
261        "maurice harkless" => 6591,
262        "demonte harper" => 2284504,
263        "justin harper" => 6438,
264        "josh harrellson" => 6439,
265        "al harrington" => 308,
266        "devin harris" => 2382,
267        "elias harris" => 2489660,
268        "mike harris" => 3081,
269        "terrel harris" => 6490,
270        "tobias harris" => 6440,
271        "udonis haslem" => 2184,
272        "spencer hawes" => 3211,
273        "chuck hayes" => 2834,
274        "gordon hayward" => 4249,
275        "lazar hayward" => 4277,
276        "brendan haywood" => 1000,
277        "gerald henderson" => 3993,
278        "jordan henriquez" => 2488823,
279        "xavier henry" => 4241,
280        "john henson" => 6592,
281        "roy hibbert" => 3436,
282        "j.j. hickson" => 3437,
283        "cory higgins" => 6544,
284        "nenĂŞ hilario" => 1713,
285        "george hill" => 3438,
286        "grant hill" => 336,
287        "jordan hill" => 3994,
288        "solomon hill" => 2488958,
289        "kirk hinrich" => 1981,
290        "jrue holiday" => 3995,
291        "justin holiday" => 2284101,
292        "ryan hollins" => 3008,
293        "tyler honeycutt" => 6441,
294        "al horford" => 3213,
295        "dwight howard" => 2384,
296        "josh howard" => 2006,
297        "juwan howard" => 351,
298        "richard howell" => 2488675,
299        "kris humphries" => 2433,
300        "serge ibaka" => 3439,
301        "andre iguodala" => 2386,
302        "ersan ilyasova" => 2767,
303        "kyrie irving" => 6442,
304        "royal ivey" => 2387,
305        "jarrett jack" => 2768,
306        "darnell jackson" => 3440,
307        "pierre jackson" => 2578204,
308        "reggie jackson" => 6443,
309        "stephen jackson" => 378,
310        "bernard james" => 6593,
311        "damion james" => 4252,
312        "lebron james" => 1966,
313        "mike james" => 1051,
314        "antawn jamison" => 385,
315        "marko jaric" => 387,
316        "livio jean-charles" => 3033028,
317        "othyus jeffers" => 4231,
318        "al jefferson" => 2389,
319        "richard jefferson" => 1006,
320        "jared jeffries" => 1717,
321        "charles jenkins" => 6444,
322        "john jenkins" => 6594,
323        "brandon jennings" => 3997,
324        "jonas jerebko" => 3998,
325        "grant jerrett" => 2991009,
326        "amir johnson" => 2769,
327        "armon johnson" => 4279,
328        "carldell johnson" => 6484,
329        "chris johnson" => 4400,
330        "chris johnson" => 2325975,
331        "ivan johnson" => 6534,
332        "jajuan johnson" => 6445,
333        "james johnson" => 3999,
334        "joe johnson" => 1007,
335        "orlando johnson" => 6595,
336        "wesley johnson" => 4247,
337        "darius johnson-odom" => 6596,
338        "cameron jones" => 6494,
339        "dahntay jones" => 2008,
340        "dequan jones" => 2325490,
341        "dominique jones" => 4246,
342        "dwayne jones" => 2819,
343        "james jones" => 2009,
344        "kevin jones" => 2326257,
345        "perry jones" => 6598,
346        "solomon jones" => 3010,
347        "terrence jones" => 6597,
348        "deandre jordan" => 3442,
349        "jerome jordan" => 4280,
350        "cory joseph" => 6446,
351        "kris joseph" => 6599,
352        "chris kaman" => 1982,
353        "enes kanter" => 6447,
354        "sergey karasev" => 2959745,
355        "coby karl" => 3251,
356        "arsalan kazemi" => 2489572,
357        "ryan kelly" => 2488651,
358        "d.j. kennedy" => 6574,
359        "d.j. kennedy" => 6574,
360        "jason kidd" => 429,
361        "michael kidd-gilchrist" => 6601,
362        "tarence kinsey" => 3045,
363        "andrei kirilenko" => 434,
364        "linas kleiza" => 2770,
365        "brandon knight" => 6448,
366        "kyle korver" => 2011,
367        "kosta koufos" => 3444,
368        "viacheslav kravtsov" => 6636,
369        "rob kurz" => 3837,
370        "doron lamb" => 6604,
371        "jeremy lamb" => 6603,
372        "carl landry" => 3217,
373        "marcus landry" => 4024,
374        "shane larkin" => 2596158,
375        "dallas lauderdale" => 2282751,
376        "joffrey lauvergne" => 2959753,
377        "ty lawson" => 4000,
378        "ricky ledo" => 2991143,
379        "courtney lee" => 3445,
380        "david lee" => 2772,
381        "malcolm lee" => 6449,
382        "alex len" => 2596107,
383        "kawhi leonard" => 6450,
384        "meyers leonard" => 6605,
385        "c.j. leslie" => 2528788,
386        "travis leslie" => 6451,
387        "jon leuer" => 6452,
388        "rashard lewis" => 469,
389        "deandre liggins" => 6453,
390        "damian lillard" => 6606,
391        "jeremy lin" => 4299,
392        "shaun livingston" => 2393,
393        "trent lockett" => 2488969,
394        "brook lopez" => 3448,
395        "robin lopez" => 3447,
396        "kevin love" => 3449,
397        "kyle lowry" => 3012,
398        "john lucas" => 2866,
399        "scott machado" => 6644,
400        "shelvin mack" => 6454,
401        "corey maggette" => 497,
402        "ian mahinmi" => 2774,
403        "shawn marion" => 510,
404        "kendall marshall" => 6607,
405        "cartier martin" => 3930,
406        "kenyon martin" => 515,
407        "kevin martin" => 2394,
408        "roger mason jr." => 1721,
409        "wesley matthews" => 4032,
410        "jason maxiell" => 2775,
411        "eric maynor" => 4001,
412        "o.j. mayo" => 3450,
413        "james mays" => 3849,
414        "luc richard mbah a moute" => 3451,
415        "ray mccallum" => 2528447,
416        "c.j. mccollum" => 2490149,
417        "richard mcconnell" => 2284647,
418        "javale mcgee" => 3452,
419        "tracy mcgrady" => 532,
420        "dominic mcguire" => 3246,
421        "ben mclemore" => 2578213,
422        "jerel mcneal" => 4158,
423        "josh mcroberts" => 3220,
424        "jodie meeks" => 4003,
425        "gal mekel" => 4218,
426        "fab melo" => 6608,
427        "khris middleton" => 6609,
428        "c.j. miles" => 2778,
429        "darko milicic" => 2171,
430        "andre miller" => 557,
431        "darius miller" => 6610,
432        "mike miller" => 558,
433        "quincy miller" => 6611,
434        "patty mills" => 4004,
435        "paul millsap" => 3015,
436        "tony mitchell" => 2489010,
437        "tony mitchell" => 2583664,
438        "nazr mohammed" => 568,
439        "greg monroe" => 4260,
440        "e'twaun moore" => 6460,
441        "etwaun moore" => 6460,
442        "carlos morais" => 3070169,
443        "darius morris" => 6463,
444        "marcus morris" => 6462,
445        "markieff morris" => 6461,
446        "adam morrison" => 3016,
447        "anthony morrow" => 3474,
448        "donatas motiejunas" => 6464,
449        "arnett moultrie" => 6612,
450        "timofey mozgov" => 4298,
451        "ismail muhammad" => 6536,
452        "shabazz muhammad" => 2993875,
453        "byron mullens" => 4005,
454        "erik murphy" => 2489021,
455        "kevin murphy" => 6613,
456        "troy murphy" => 1013,
457        "ronald murray" => 1777,
458        "toure' murry" => 2327107,
459        "toure murry" => 2327107,
460        "steve nash" => 592,
461        "hamady ndiaye" => 4282,
462        "gary neal" => 4300,
463        "nemanja nedovic" => 2959736,
464        "jameer nelson" => 2439,
465        "reeves nelson" => 6642,
466        "raul neto" => 2968361,
467        "luke nevill" => 4162,
468        "andrew nicholson" => 6614,
469        "joakim noah" => 3224,
470        "nerlens noel" => 2991280,
471        "lucas nogueira" => 3032980,
472        "steve novak" => 3018,
473        "dirk nowitzki" => 609,
474        "jermaine o'neal" => 615,
475        "jermaine oneal" => 615,
476        "kyle o'quinn" => 6615,
477        "kyle oquinn" => 6615,
478        "greg oden" => 3225,
479        "lamar odom" => 617,
480        "tim ohlbrecht" => 2308999,
481        "emeka okafor" => 2399,
482        "victor oladipo" => 2527963,
483        "kelly olynyk" => 2489663,
484        "arinze onuaku" => 2202117,
485        "daniel orton" => 4263,
486        "romero osby" => 2327632,
487        "travis outlaw" => 2015,
488        "zaza pachulia" => 2016,
489        "jannero pargo" => 1821,
490        "jeremy pargo" => 6497,
491        "tony parker" => 1015,
492        "chandler parsons" => 6466,
493        "patrick patterson" => 4264,
494        "chris paul" => 2779,
495        "sasha pavlovic" => 2172,
496        "nikola pekovic" => 3453,
497        "kendrick perkins" => 2018,
498        "johan petro" => 2780,
499        "paul pierce" => 662,
500        "mickael pietrus" => 2173,
501        "dexter pittman" => 4283,
502        "trent plaisted" => 3454,
503        "mason plumlee" => 2488653,
504        "miles plumlee" => 6616,
505        "quincy pondexter" => 4253,
506        "otto porter jr." => 2594922,
507        "josh powell" => 2197,
508        "phil pressey" => 2530722,
509        "a.j. price" => 4010,
510        "ronnie price" => 2807,
511        "pablo prigioni" => 4182,
512        "tayshaun prince" => 1724,
513        "joel przybilla" => 682,
514        "chris quinn" => 3046,
515        "vladimir radmanovic" => 1016,
516        "miroslav raduljica" => 3047256,
517        "anthony randolph" => 3455,
518        "shavlik randolph" => 2810,
519        "zach randolph" => 1017,
520        "andy rautins" => 4285,
521        "j.j. redick" => 3024,
522        "willie reed" => 2326015,
523        "glen rice jr." => 2488660,
524        "jason richardson" => 1018,
525        "quentin richardson" => 703,
526        "luke ridnour" => 1985,
527        "austin rivers" => 6617,
528        "andre roberson" => 2530596,
529        "brian roberts" => 6641,
530        "nate robinson" => 2782,
531        "thomas robinson" => 6618,
532        "rajon rondo" => 3026,
533        "derrick rose" => 3456,
534        "terrence ross" => 6619,
535        "brandon roy" => 3027,
536        "ricky rubio" => 4011,
537        "brandon rush" => 3457,
538        "robert sacre" => 6620,
539        "john salmons" => 1726,
540        "samardo samuels" => 4304,
541        "larry sanders" => 4265,
542        "dennis schroeder" => 3032979,
543        "luis scola" => 1781,
544        "carleton scott" => 6648,
545        "mike scott" => 6622,
546        "devin searcy" => 6659,
547        "thabo sefolosha" => 3028,
548        "josh selby" => 6467,
549        "kevin seraphin" => 4289,
550        "ramon sessions" => 3231,
551        "tornike shengelia" => 6623,
552        "iman shumpert" => 6468,
553        "john shurna" => 6646,
554        "alexey shved" => 3882,
555        "henry sims" => 6647,
556        "kyle singler" => 6469,
557        "chris singleton" => 6470,
558        "peyton siva" => 2488706,
559        "donald sloan" => 4303,
560        "chris smith" => 6639,
561        "greg smith" => 6530,
562        "ish smith" => 4305,
563        "j.r. smith" => 2444,
564        "jamar smith" => 3118,
565        "jason smith" => 3232,
566        "josh smith" => 2411,
567        "nolan smith" => 6471,
568        "tony snell" => 2528353,
569        "greg somogyi" => 6643,
570        "james southerland" => 2488749,
571        "marreese speights" => 3460,
572        "tiago splitter" => 3233,
573        "jerry stackhouse" => 802,
574        "lance stephenson" => 4244,
575        "deshawn stevenson" => 808,
576        "greg stiemsma" => 4235,
577        "julyan stone" => 6543,
578        "amar'e stoudemire" => 1727,
579        "amare stoudemire" => 1727,
580        "rodney stuckey" => 3235,
581        "jared sullinger" => 6624,
582        "dajuan summers" => 4012,
583        "jeffery taylor" => 6156,
584        "jermaine taylor" => 4014,
585        "tyshawn taylor" => 6625,
586        "jeff teague" => 4015,
587        "marquis teague" => 6626,
588        "mirza teletovic" => 4385,
589        "sebastian telfair" => 2417,
590        "garrett temple" => 4023,
591        "jason terry" => 841,
592        "hasheem thabeet" => 4016,
593        "deshaun thomas" => 2528235,
594        "isaiah thomas" => 6472,
595        "kurt thomas" => 846,
596        "lance thomas" => 6485,
597        "malcolm thomas" => 6511,
598        "tyrus thomas" => 3032,
599        "hollis thompson" => 6634,
600        "jason thompson" => 3462,
601        "klay thompson" => 6475,
602        "mychel thompson" => 6523,
603        "tristan thompson" => 6474,
604        "hank thorns" => 2282204,
605        "marcus thornton" => 4017,
606        "janis timma" => 3037804,
607        "jamaal tinsley" => 1024,
608        "anthony tolliver" => 3276,
609        "alando tucker" => 3238,
610        "p.j. tucker" => 3033,
611        "ronny turiaf" => 2789,
612        "hedo turkoglu" => 862,
613        "evan turner" => 4239,
614        "jeremy tyler" => 6476,
615        "ekpe udoh" => 4261,
616        "beno udrih" => 2448,
617        "ben uzoh" => 4296,
618        "jonas valanciunas" => 6477,
619        "anderson varejao" => 2419,
620        "jarvis varnado" => 4266,
621        "greivis vasquez" => 4291,
622        "jan vesely" => 4165,
623        "charlie villanueva" => 2792,
624        "nikola vucevic" => 6478,
625        "dwyane wade" => 1987,
626        "dion waiters" => 6628,
627        "kemba walker" => 6479,
628        "john wall" => 4237,
629        "gerald wallace" => 1026,
630        "rasheed wallace" => 883,
631        "luke walton" => 2027,
632        "hakim warrick" => 2794,
633        "c.j. watson" => 3277,
634        "earl watson" => 1027,
635        "maalik wayns" => 6638,
636        "kyle weaver" => 3466,
637        "martell webster" => 2795,
638        "david west" => 2177,
639        "delonte west" => 2422,
640        "russell westbrook" => 3468,
641        "d.j. white" => 3469,
642        "james white" => 3037,
643        "royce white" => 6629,
644        "chris wilcox" => 1731,
645        "tyler wilkerson" => 2233314,
646        "damien wilkins" => 2506,
647        "deron williams" => 2798,
648        "derrick williams" => 6480,
649        "louis williams" => 2799,
650        "marvin williams" => 2797,
651        "mo williams" => 2178,
652        "reggie williams" => 4229,
653        "shawne williams" => 3038,
654        "terrence williams" => 4019,
655        "wesley witherspoon" => 2326505,
656        "jeff withey" => 2333797,
657        "nate wolters" => 2491079,
658        "metta world peace" => 25,
659        "brandan wright" => 3242,
660        "chris wright" => 6501,
661        "chris wright" => 6666,
662        "dorell wright" => 2423,
663        "tony wroten" => 6630,
664        "bj young" => 2581000,
665        "nick young" => 3243,
666        "sam young" => 4020,
667        "thaddeus young" => 3244,
668        "cody zeller" => 2579258,
669        "luke zeller" => 6502,
670        "tyler zeller" => 6631,
671    }
672);
673
674# Transform %leagues into player => { league => "league_name", id => id_number }
675# to keep %leagues in a friendly/dry form, but keep fast lookups. This only
676# executes once.
677my %players;
678for my $league (keys %leagues) {
679    for my $player (keys %{$leagues{$league}}) {
680        $players{$player} = +{
681            id => $leagues{$league}{$player},
682            league => $league,
683        };
684    }
685}
686
687triggers any => keys %players;
688
689spice to => 'http://api.espn.com/v1/sports/basketball/$1/$2/$3/$4'
690            . '?enable=stats,competitors,roster,venues&$5='
691            . (localtime->year() + 1900 + 1)
692            . '&apikey={{ENV{DDG_SPICE_ESPN_APIKEY}}}&callback=$6';
693
694spice from => '(.*)/(.*)/(.*)/(.*)/(.*)/(.*)';
695
696handle query_lc => sub {
697    return $players{$_}{league}, "athletes", $players{$_}{id}, "foo", "bar", "ddg_spice_espn";
698};
699
7001;