PageRenderTime 169ms CodeModel.GetById 2ms app.highlight 157ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/DDG/Spice/ESPN/Golf.pm

https://github.com/ehsan/zeroclickinfo-spice
Perl | 1016 lines | 1004 code | 9 blank | 3 comment | 3 complexity | d791d7a5a8c9e2dd9e416085affac12f MD5 | raw file
   1package DDG::Spice::ESPN::Golf;
   2
   3use DDG::Spice;
   4use Time::localtime;
   5
   6description "News and stats for golf players";
   7name "ESPN Golf";
   8primary_example_queries "Tiger Woods", "Jeff Maggert";
   9topics "entertainment", "special_interest";
  10category "reference";
  11code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/ESPN/Golf.pm";
  12attribution web => ['http://duckduckgo.com', 'DuckDuckGo'],
  13            twitter => ['http://twitter.com/duckduckgo', 'duckduckgo'];
  14
  15my %leagues = (
  16    pga => {
  17        "jamie abbott" => 5549,
  18        "warren abery" => 1578,
  19        "blake adams" => 3227,
  20        "frank adams" => 1808,
  21        "alfredo adrian" => 5019,
  22        "felipe aguilar" => 4240,
  23        "jaco ahlers" => 4632,
  24        "antti ahokas" => 4242,
  25        "thomas aiken" => 1436,
  26        "steve allan" => 2,
  27        "robert allenby" => 5,
  28        "max alverio" => 4243,
  29        "stephen ames" => 7,
  30        "byeong-hun an" => 5285,
  31        "jc anderson" => 781,
  32        "josh anderson" => 4051,
  33        "mark anderson" => 1830,
  34        "fredrik andersson hed" => 872,
  35        "billy andrade" => 10,
  36        "kiradech aphibarnrat" => 5771,
  37        "stuart appleby" => 11,
  38        "philip archer" => 1437,
  39        "connor arendell" => 6781,
  40        "alvaro arizabaleta" => 6671,
  41        "michael arnaud" => 4412,
  42        "arjun atwal" => 824,
  43        "woody austin" => 14,
  44        "joakim backstrom" => 1439,
  45        "aaron baddeley" => 16,
  46        "sang-moon bae" => 4015,
  47        "ross bain" => 3458,
  48        "mark baker" => 3480,
  49        "matthew baldwin" => 5832,
  50        "danny balin" => 5670,
  51        "wade ballard" => 6604,
  52        "eric banks" => 9124,
  53        "michael barbosa" => 6006,
  54        "justin bardgett" => 5884,
  55        "benn barham" => 874,
  56        "kurt barnes" => 3647,
  57        "ricky barnes" => 801,
  58        "scott barr" => 1279,
  59        "brian bateman" => 690,
  60        "rich beem" => 29,
  61        "oliver bekker" => 5097,
  62        "charlie beljan" => 3777,
  63        "brad benjamin" => 5286,
  64        "warren bennett" => 864,
  65        "frank bensel" => 1322,
  66        "brett bergeron" => 7077,
  67        "gaganjeet bhullar" => 4309,
  68        "john bickerton" => 503,
  69        "tommy biershenk" => 761,
  70        "bryan bigley" => 5960,
  71        "kyle bilodeau" => 8998,
  72        "lucas bjerregaard" => 6054,
  73        "thomas bjorn" => 37,
  74        "jacques blaauw" => 4071,
  75        "chris black" => 6890,
  76        "bennett blakeman" => 5498,
  77        "adam bland" => 1688,
  78        "rich bland" => 1441,
  79        "kris blanks" => 1933,
  80        "ryan blaum" => 1935,
  81        "jonas blixt" => 3856,
  82        "rohan blizard" => 3818,
  83        "michael block" => 3312,
  84        "jason bohn" => 1173,
  85        "justin bolli" => 1354,
  86        "andre bossert" => 1514,
  87        "desvonde botes" => 1349,
  88        "marcus both" => 1442,
  89        "gregory bourdy" => 1443,
  90        "matt bova" => 7174,
  91        "steven bowditch" => 1112,
  92        "gary boyd" => 3820,
  93        "keegan bradley" => 4513,
  94        "michael bradley" => 49,
  95        "david bradshaw" => 3538,
  96        "paul bradshaw" => 1300,
  97        "christian brand" => 6146,
  98        "markus brier" => 506,
  99        "paul broadhurst" => 1280,
 100        "billy ray brown" => 57,
 101        "mark brown" => 4033,
 102        "mark brown" => 596,
 103        "scott brown" => 4591,
 104        "dan buchner" => 1982,
 105        "dave bunker" => 5583,
 106        "bob burns" => 61,
 107        "kevin burton" => 1145,
 108        "andrew butterfield" => 1445,
 109        "jonathan byrd" => 508,
 110        "david byrne" => 6743,
 111        "angel cabrera" => 65,
 112        "federico cabrera" => 4690,
 113        "rafael cabrera bello" => 4321,
 114        "angel cabrera jr" => 7128,
 115        "brian cairns" => 597,
 116        "jonathan caldwell" => 4077,
 117        "robert calvesbert" => 6672,
 118        "chad campbell" => 68,
 119        "michael campbell" => 67,
 120        "jorge campillo" => 4691,
 121        "todd camplin" => 5961,
 122        "rafael campos" => 3683,
 123        "juan campusano" => 6673,
 124        "alejandro canizares" => 1763,
 125        "emanuele canonica" => 69,
 126        "laurie canter" => 5550,
 127        "mike carbone" => 1735,
 128        "kevin carll" => 1355,
 129        "magnus carlsson" => 70,
 130        "mark carnevale" => 511,
 131        "david carr" => 1249,
 132        "kevin carrigan" => 9125,
 133        "brian carroll" => 3815,
 134        "david carter" => 1447,
 135        "pat carter" => 9033,
 136        "gregory casagranda" => 1363,
 137        "paul casey" => 72,
 138        "roberto castro" => 3740,
 139        "bud cauley" => 5338,
 140        "christian cevaer" => 1282,
 141        "greg chalmers" => 74,
 142        "kevin chappell" => 3857,
 143        "neil cheetham" => 516,
 144        "danny chia" => 1517,
 145        "k.j. choi" => 77,
 146        "s.s.p. chowrasia" => 3680,
 147        "gary christian" => 2044,
 148        "david chung" => 5903,
 149        "victor ciesielski" => 1739,
 150        "stewart cink" => 78,
 151        "gary clark" => 4323,
 152        "tim clark" => 81,
 153        "darren clarke" => 82,
 154        "will claxton" => 2053,
 155        "keith clearwater" => 83,
 156        "jose coceres" => 84,
 157        "george coetzee" => 5076,
 158        "robert coles" => 518,
 159        "wil collins" => 1408,
 160        "nicolas colsaerts" => 1283,
 161        "andrew coltart" => 485,
 162        "erik compton" => 646,
 163        "corey conners" => 9126,
 164        "donald constable" => 7078,
 165        "javier cordova" => 5885,
 166        "lee corfield" => 6043,
 167        "matthew cort" => 521,
 168        "chris couch" => 1177,
 169        "rob couture" => 6932,
 170        "ben crane" => 693,
 171        "jeffrey cranford" => 93,
 172        "brandon crick" => 5617,
 173        "andre cruse" => 1448,
 174        "nick cullen" => 5007,
 175        "josh cunliffe" => 3821,
 176        "jeff curl" => 2098,
 177        "ben curtis" => 523,
 178        "adilson da silva" => 3460,
 179        "john daly" => 97,
 180        "david damesworth" => 6688,
 181        "steve dartnall" => 3519,
 182        "olivier david" => 1449,
 183        "keenan davidse" => 4086,
 184        "rhys davies" => 3314,
 185        "brian davis" => 1049,
 186        "glen day" => 100,
 187        "jason day" => 1680,
 188        "brendon de jonge" => 1758,
 189        "eduardo de la riva" => 4399,
 190        "floris de vries" => 4832,
 191        "leigh deagan" => 4088,
 192        "graham delaet" => 2127,
 193        "robert-jan derksen" => 1083,
 194        "chris devlin" => 2140,
 195        "casey devoll" => 2122,
 196        "chris dimarco" => 105,
 197        "robert dinwiddie" => 1797,
 198        "david dixon" => 524,
 199        "christopher doak" => 4335,
 200        "matt dobyns" => 6899,
 201        "stephen dodd" => 1519,
 202        "andrew dodt" => 3639,
 203        "greg doherty" => 6933,
 204        "luke donald" => 601,
 205        "jamie donaldson" => 1451,
 206        "nick dougherty" => 1019,
 207        "dennis downs" => 6992,
 208        "bradley dredge" => 865,
 209        "james driscoll" => 109,
 210        "warrick druian" => 1452,
 211        "scott drummond" => 1284,
 212        "david drysdale" => 1453,
 213        "victor dubuisson" => 5402,
 214        "jason dufner" => 110,
 215        "eric dugas" => 3941,
 216        "ken duke" => 745,
 217        "alan dunbar" => 5615,
 218        "david duval" => 115,
 219        "simon dyson" => 525,
 220        "pelle edberg" => 3461,
 221        "johan edfors" => 1692,
 222        "matthew edwards" => 6009,
 223        "simon edwards" => 5555,
 224        "john ellis" => 1197,
 225        "ernie els" => 123,
 226        "jamie elson" => 3822,
 227        "harris english" => 5408,
 228        "sean english" => 1323,
 229        "scott erdmann" => 6158,
 230        "klas eriksson" => 1285,
 231        "martin erlandsson" => 1303,
 232        "derek ernst" => 7004,
 233        "bob estes" => 125,
 234        "joaquin estevez" => 5967,
 235        "gary evans" => 866,
 236        "matt every" => 1411,
 237        "nick faldo" => 127,
 238        "niclas fasth" => 526,
 239        "gonzalo fdez-castano" => 1455,
 240        "ben ferguson" => 132,
 241        "derik ferreira" => 4096,
 242        "jess ferrell" => 6847,
 243        "kenneth ferrie" => 1085,
 244        "darren fichardt" => 868,
 245        "jack fields" => 6832,
 246        "edward figueroa" => 6674,
 247        "tony finau" => 2230,
 248        "richard finch" => 1456,
 249        "todd fischer" => 135,
 250        "zack fischer" => 7158,
 251        "oliver fisher" => 4274,
 252        "ross fisher" => 3462,
 253        "caine fitzgerald" => 9097,
 254        "matthew fitzpatrick" => 9037,
 255        "steve flesch" => 136,
 256        "gavin flint" => 1511,
 257        "kyle flinton" => 3944,
 258        "oscar floren" => 1521,
 259        "martin flores" => 1637,
 260        "jonathan fly" => 6799,
 261        "grant forrest" => 6958,
 262        "alastair forsyth" => 1086,
 263        "mark foster" => 1087,
 264        "michael foster" => 4100,
 265        "rickie fowler" => 3702,
 266        "steven fox" => 7102,
 267        "garrett frank" => 2257,
 268        "marcus fraser" => 1457,
 269        "harrison frazar" => 144,
 270        "brad fritsch" => 147,
 271        "charles frost" => 4589,
 272        "michael frye" => 6900,
 273        "tadd fujikawa" => 1649,
 274        "yoshinori fujimoto" => 6845,
 275        "hiroyuki fujita" => 694,
 276        "jim furyk" => 153,
 277        "brian gaffney" => 4735,
 278        "tommy gainey" => 1798,
 279        "stephen gallacher" => 1412,
 280        "robert gamez" => 156,
 281        "chris gane" => 1459,
 282        "stephen gangluff" => 157,
 283        "jorge garcia" => 7125,
 284        "sergio garcia" => 158,
 285        "scott gardiner" => 3236,
 286        "tom gardner" => 6665,
 287        "alejandro garmendia" => 6670,
 288        "ignacio garrido" => 1088,
 289        "robert garrigus" => 1254,
 290        "robert gates" => 4590,
 291        "daniel gaunt" => 4706,
 292        "robert gaus" => 3514,
 293        "brian gay" => 159,
 294        "andrew georgiou" => 5121,
 295        "nicolas geyger" => 4105,
 296        "mitchell gillis" => 6606,
 297        "tom gillis" => 804,
 298        "david gleeson" => 1462,
 299        "michael gligic" => 4859,
 300        "lucas glover" => 676,
 301        "maximiliano godoy" => 6675,
 302        "fabian gomez" => 3375,
 303        "jean baptiste gonnet" => 3823,
 304        "andres gonzales" => 1748,
 305        "ricardo gonzalez" => 869,
 306        "retief goosen" => 167,
 307        "scott gordon" => 2316,
 308        "jeff gove" => 171,
 309        "estanislao goya" => 4244,
 310        "tano goya" => 4571,
 311        "paul goydos" => 173,
 312        "branden grace" => 4383,
 313        "austin graham" => 6666,
 314        "richard green" => 528,
 315        "greg gregory" => 679,
 316        "christo greyling" => 3606,
 317        "cody gribble" => 8971,
 318        "lanto griffin" => 5962,
 319        "glen griffith" => 7105,
 320        "david griffiths" => 1315,
 321        "emiliano grillo" => 5882,
 322        "adam groom" => 1463,
 323        "julien guerrier" => 1694,
 324        "vaita guillaume" => 6953,
 325        "austin gutgsell" => 6797,
 326        "luke guthrie" => 6066,
 327        "bill haas" => 774,
 328        "jerry haas" => 818,
 329        "brian hadley" => 2356,
 330        "joakim haeggman" => 1255,
 331        "james hahn" => 5025,
 332        "john hahn" => 8972,
 333        "anton haig" => 1779,
 334        "shun yat jason hak" => 4110,
 335        "paul haley ii" => 6607,
 336        "gavin hall" => 5663,
 337        "alex hamilton" => 4515,
 338        "hunter hamrick" => 6806,
 339        "chang-won han" => 5314,
 340        "seung-su han" => 1132,
 341        "kirk hanefeld" => 1153,
 342        "anders hansen" => 847,
 343        "soren hansen" => 532,
 344        "peter hanson" => 1414,
 345        "justin harding" => 5825,
 346        "brian harman" => 1225,
 347        "padraig harrington" => 186,
 348        "dudley hart" => 188,
 349        "andreas hartoe" => 6010,
 350        "tyrrell hatton" => 5553,
 351        "richard hattori" => 7096,
 352        "gregory havret" => 3477,
 353        "j.p. hayes" => 191,
 354        "thomas haylock" => 4711,
 355        "david hearn" => 928,
 356        "benjamin hebert" => 3824,
 357        "peter hedblom" => 1288,
 358        "wes heffernan" => 192,
 359        "mike heinen" => 193,
 360        "scott hend" => 1178,
 361        "scott henderson" => 535,
 362        "mike hendry" => 4252,
 363        "fredrik henge" => 1466,
 364        "nolan henke" => 194,
 365        "kip henley" => 828,
 366        "russell henley" => 5409,
 367        "j.j. henry" => 196,
 368        "mark hensby" => 197,
 369        "jim herman" => 3598,
 370        "eduardo herrera" => 697,
 371        "tim herron" => 198,
 372        "justin hicks" => 199,
 373        "david higgins" => 3464,
 374        "craig hinton" => 6044,
 375        "tetsuji hiratsuka" => 1179,
 376        "bo hoag" => 4780,
 377        "michael hoey" => 536,
 378        "charley hoffman" => 205,
 379        "morgan hoffmann" => 4781,
 380        "charlie holland" => 8935,
 381        "j.b. holmes" => 1067,
 382        "creighton honeck" => 6140,
 383        "keith horne" => 4311,
 384        "billy horschel" => 1651,
 385        "david horsey" => 3825,
 386        "beau hossler" => 6011,
 387        "garry houston" => 1468,
 388        "cole howard" => 6025,
 389        "jamie howarth" => 3826,
 390        "david howell" => 537,
 391        "charles howell iii" => 208,
 392        "mu hu" => 5322,
 393        "mark hubbard" => 9143,
 394        "bobby hudson" => 6002,
 395        "mackenzie hughes" => 6931,
 396        "jean hugo" => 538,
 397        "john huh" => 5797,
 398        "phillip hui" => 6687,
 399        "jeppe huldahl" => 4286,
 400        "shaaban hussin" => 5267,
 401        "david hutsell" => 790,
 402        "brian hutton" => 6087,
 403        "greg huxman" => 6060,
 404        "jay hwang" => 6646,
 405        "jung-gon hwang" => 6042,
 406        "kodai ichihara" => 4318,
 407        "steven ihm" => 9071,
 408        "yuta ikeda" => 4712,
 409        "mikko ilonen" => 213,
 410        "daniel im" => 3813,
 411        "trevor immelman" => 215,
 412        "paul imondi" => 6647,
 413        "makoto inoue" => 9075,
 414        "steve irwin" => 6012,
 415        "ryo ishikawa" => 4047,
 416        "hiroshi iwata" => 3827,
 417        "freddie jacobson" => 540,
 418        "raphael jacquelin" => 541,
 419        "thongchai jaidee" => 222,
 420        "faber jamerson" => 6156,
 421        "scott jamieson" => 3729,
 422        "steven jeffress" => 3656,
 423        "marty jertson" => 5769,
 424        "miguel jimenez" => 224,
 425        "brandt jobe" => 225,
 426        "per-ulrik johansson" => 226,
 427        "amandeep johl" => 1469,
 428        "dustin johnson" => 3448,
 429        "zach johnson" => 686,
 430        "andrew johnston" => 5838,
 431        "cameron johnston" => 4120,
 432        "brendan jones" => 1256,
 433        "matt jones" => 1367,
 434        "michael jonzon" => 4273,
 435        "pariya junhasavasdikul" => 5772,
 436        "erick justesen" => 4014,
 437        "james kamte" => 4261,
 438        "anthony kang" => 239,
 439        "shiv kapur" => 1583,
 440        "rikard karlberg" => 5349,
 441        "robert karlsson" => 544,
 442        "peter karmis" => 3806,
 443        "shingo katayama" => 240,
 444        "chris kaufman" => 6676,
 445        "jeremy kavanagh" => 4636,
 446        "hiroo kawai" => 6045,
 447        "martin kaymer" => 3670,
 448        "ian keenan" => 5828,
 449        "alpheus kelapile" => 4125,
 450        "jerry kelly" => 243,
 451        "troy kelly" => 1416,
 452        "brad kennedy" => 1470,
 453        "billy kennerly" => 6171,
 454        "darrell kestner" => 608,
 455        "simon khan" => 1471,
 456        "anthony kim" => 1745,
 457        "do-hoon kim" => 4503,
 458        "hank kim" => 832,
 459        "hyung-sung kim" => 4270,
 460        "kyung-tae kim" => 8858,
 461        "lion kim" => 5904,
 462        "michael kim" => 8974,
 463        "sunny kim" => 5034,
 464        "john kimbell" => 2545,
 465        "james kingston" => 878,
 466        "chris kirk" => 3449,
 467        "soren kjeldsen" => 547,
 468        "colt knost" => 1793,
 469        "jason knutzon" => 1055,
 470        "masanori kobayashi" => 7042,
 471        "satoshi kodaira" => 9076,
 472        "brooks koepka" => 6798,
 473        "ben kohles" => 6922,
 474        "jason kokrak" => 3317,
 475        "greg kraft" => 253,
 476        "jbe' kruger" => 4993,
 477        "jbe kruger" => 4993,
 478        "kenichi kuboya" => 850,
 479        "matt kuchar" => 257,
 480        "hank kuehne" => 791,
 481        "rick kulacz" => 3641,
 482        "chad kurmel" => 1773,
 483        "parker labarge" => 4822,
 484        "doug labelle ii" => 1057,
 485        "rob labritz" => 259,
 486        "maarten lafeber" => 1058,
 487        "anirban lahiri" => 4989,
 488        "martin laird" => 2571,
 489        "chih-bing lam" => 3466,
 490        "steven lam" => 4131,
 491        "derek lamely" => 1276,
 492        "joey lamielle" => 2574,
 493        "steve lamontagne" => 4409,
 494        "neal lancaster" => 260,
 495        "scott langley" => 5506,
 496        "jose manuel lara" => 1473,
 497        "brad lardon" => 701,
 498        "pablo larrazabal" => 3829,
 499        "mark laskey" => 5440,
 500        "paul lawrie" => 265,
 501        "peter lawrie" => 1474,
 502        "peter laws" => 1160,
 503        "steve lebrun" => 1381,
 504        "nelson lautaro ledesma" => 6677,
 505        "d.h. lee" => 3608,
 506        "d.h. lee" => 7107,
 507        "dong-hwan lee" => 3467,
 508        "han lee" => 741,
 509        "kyoung-hoon lee" => 7083,
 510        "richard lee" => 6644,
 511        "richard lee" => 3318,
 512        "steve lee" => 6013,
 513        "marc leishman" => 3351,
 514        "hugo leon" => 4138,
 515        "justin leonard" => 269,
 516        "michael letzig" => 2603,
 517        "thomas levet" => 551,
 518        "tom lewis" => 5868,
 519        "chao li" => 4427,
 520        "wc liang" => 5862,
 521        "wc liang" => 5209,
 522        "frank lickliter ii" => 272,
 523        "simon lilly" => 4596,
 524        "jose filipe lima" => 1417,
 525        "wen-tang lin" => 4232,
 526        "david lingmerth" => 5574,
 527        "luke list" => 1059,
 528        "sam little" => 1476,
 529        "darryn lloyd" => 4141,
 530        "brian locke" => 6014,
 531        "gary lockerbie" => 1696,
 532        "olafur loftsson" => 6172,
 533        "jonathan lomas" => 1418,
 534        "ken looper" => 8881,
 535        "davis love iii" => 278,
 536        "mitch lowe" => 279,
 537        "justin lower" => 9144,
 538        "randy lowry" => 4926,
 539        "shane lowry" => 4587,
 540        "jean-francois lucquin" => 1477,
 541        "joost luiten" => 4831,
 542        "bill lunde" => 1060,
 543        "jarrod lyle" => 1698,
 544        "david lynn" => 1092,
 545        "jimmy lytle" => 6235,
 546        "morten orum madsen" => 6628,
 547        "jeff maggert" => 283,
 548        "hunter mahan" => 957,
 549        "gregor main" => 4053,
 550        "john mallinger" => 1419,
 551        "mardan mamat" => 1522,
 552        "matteo manassero" => 4574,
 553        "michael maness" => 3542,
 554        "stuart manley" => 1478,
 555        "steve marino" => 1170,
 556        "martin maritz" => 1479,
 557        "prayad marksaeng" => 3687,
 558        "fran marrello" => 287,
 559        "andrew marshall" => 1523,
 560        "ian marshall" => 6824,
 561        "matt marshall" => 5657,
 562        "jeff martin" => 1335,
 563        "mike martin" => 1133,
 564        "pablo martin" => 1768,
 565        "daisuke maruyama" => 1207,
 566        "shigeki maruyama" => 289,
 567        "bobby massa" => 7163,
 568        "david mathis" => 1346,
 569        "michio matsumura" => 3830,
 570        "hideki matsuyama" => 5860,
 571        "troy matteson" => 1041,
 572        "andy matthews" => 3320,
 573        "llewellyn matthews" => 3469,
 574        "nyasha mauchaza" => 6173,
 575        "brian maurer" => 6051,
 576        "david may" => 6016,
 577        "gareth maybin" => 4268,
 578        "billy mayfair" => 296,
 579        "mike mccabe" => 3968,
 580        "brian mccann" => 1722,
 581        "maxwell mccardle" => 4151,
 582        "scott mccarron" => 298,
 583        "sean mccarty" => 1062,
 584        "robert mcclellan" => 2686,
 585        "mark mccormick" => 6800,
 586        "brent mccullough" => 4153,
 587        "graeme mcdowell" => 301,
 588        "cory mcelyea" => 8987,
 589        "richard mcevoy" => 1480,
 590        "paul mcginley" => 486,
 591        "william mcgirt" => 3532,
 592        "jim mcgovern" => 302,
 593        "ross mcgowan" => 3788,
 594        "damien mcgrane" => 3831,
 595        "doug mcguigan" => 1525,
 596        "francis mcguirk" => 6047,
 597        "rory mcilroy" => 3470,
 598        "parker mclachlin" => 1259,
 599        "andrew mclardy" => 303,
 600        "alan mclean" => 1481,
 601        "james mclean" => 4040,
 602        "john mclean" => 4154,
 603        "jay mcluen" => 2708,
 604        "david mcnabb" => 9098,
 605        "george mcneill" => 808,
 606        "matt mcquillan" => 2713,
 607        "spike mcroy" => 304,
 608        "prom meesawat" => 1780,
 609        "eric meierdierks" => 4955,
 610        "john merrick" => 1422,
 611        "kevin messer" => 5887,
 612        "shaun micheel" => 307,
 613        "alan michell" => 1482,
 614        "phil mickelson" => 308,
 615        "matthew millar" => 3674,
 616        "dennis miller" => 2730,
 617        "jordan mitchell" => 7037,
 618        "kelly mitchum" => 1024,
 619        "bryce molder" => 312,
 620        "edoardo molinari" => 1527,
 621        "francesco molinari" => 1483,
 622        "cesar monasterio" => 1484,
 623        "jonathan moore" => 1654,
 624        "patrick moore" => 971,
 625        "ryan moore" => 809,
 626        "titch moore" => 1485,
 627        "wilfredo morales" => 1028,
 628        "scott moran" => 3804,
 629        "john morgan" => 4042,
 630        "colm moriarty" => 4672,
 631        "dustin morris" => 6801,
 632        "matthew morris" => 1486,
 633        "james morrison" => 4566,
 634        "rob moss" => 1552,
 635        "jesse mueller" => 2767,
 636        "jimmy mullen" => 9036,
 637        "grant muller" => 1292,
 638        "muhammad munir" => 5022,
 639        "c muniyappa" => 4960,
 640        "alejandro munoz" => 6668,
 641        "artemio murakami" => 3789,
 642        "william murchison, iii" => 7086,
 643        "mark murless" => 4930,
 644        "gary murphy" => 1094,
 645        "george murray" => 4392,
 646        "grayson murray" => 5462,
 647        "tom murray" => 6236,
 648        "toshinori muto" => 1699,
 649        "david muttitt" => 9099,
 650        "kevin na" => 318,
 651        "chris naegel" => 8876,
 652        "jake narro" => 778,
 653        "savio nazareth" => 3955,
 654        "matthew nesmith" => 6954,
 655        "musolo nethunzwi" => 4165,
 656        "jack newman" => 4415,
 657        "john nieporte" => 4245,
 658        "chapchai nirat" => 3681,
 659        "daniel nisbet" => 4984,
 660        "seung-yul noh" => 4267,
 661        "seung-yul noh" => 5481,
 662        "alexander noren" => 3832,
 663        "henrik norlander" => 5573,
 664        "paul norris" => 2802,
 665        "glenn northcutt" => 6609,
 666        "mike northern" => 616,
 667        "brett nutt" => 324,
 668        "sean o'hair" => 1359,
 669        "sean ohair" => 1359,
 670        "steven o'hara" => 1488,
 671        "steven ohara" => 1488,
 672        "dean o'riley" => 4169,
 673        "dean oriley" => 4169,
 674        "arron oberholser" => 326,
 675        "dan obremski" => 9034,
 676        "john oda" => 6642,
 677        "koumei oda" => 4713,
 678        "joe ogilvie" => 327,
 679        "geoff ogilvy" => 328,
 680        "david oh" => 1204,
 681        "james oh" => 2816,
 682        "jose maria olazabal" => 329,
 683        "thorbjorn olesen" => 5140,
 684        "nate olivo" => 5973,
 685        "dan olsen" => 1182,
 686        "leif olson" => 1260,
 687        "eric onesi" => 5817,
 688        "louis oosthuizen" => 1293,
 689        "pedro oriol" => 4546,
 690        "gary orr" => 331,
 691        "garrett osborn" => 3594,
 692        "sam osborne" => 4890,
 693        "william osborne" => 6723,
 694        "hennie otto" => 1120,
 695        "jeff overton" => 1564,
 696        "greg owen" => 560,
 697        "juvic pagunsan" => 1755,
 698        "ryan palmer" => 962,
 699        "cheng tsung pan" => 6017,
 700        "joe panzeri" => 5920,
 701        "anthony paolucci" => 5865,
 702        "deane pappas" => 706,
 703        "jae-bum park" => 5363,
 704        "jin park" => 922,
 705        "unho park" => 1700,
 706        "jesper parnevik" => 336,
 707        "andrew parr" => 3445,
 708        "bryn parry" => 640,
 709        "john parry" => 4671,
 710        "steven parry" => 3478,
 711        "brett patterson" => 6018,
 712        "carl paulson" => 343,
 713        "jeff peck" => 2842,
 714        "eddie pepperell" => 6629,
 715        "cameron percy" => 1121,
 716        "pat perez" => 707,
 717        "rod perry" => 667,
 718        "justin peters" => 350,
 719        "carl pettersson" => 856,
 720        "chinnarat phadungsil" => 4447,
 721        "kevin phelan" => 5500,
 722        "scott piercy" => 1037,
 723        "d.a. points" => 1196,
 724        "ryan polzin" => 9100,
 725        "daniel popovic" => 7007,
 726        "garrick porteous" => 9028,
 727        "ted potter, jr." => 2883,
 728        "ian poulter" => 619,
 729        "kieran pratt" => 4176,
 730        "alistair presnell" => 3676,
 731        "anthony price" => 6903,
 732        "phillip price" => 359,
 733        "dicky pride" => 360,
 734        "chad proehl" => 3816,
 735        "cody proveaux" => 6802,
 736        "corey prugh" => 2890,
 737        "rhys pugh" => 6777,
 738        "ted purdy" => 997,
 739        "angelo que" => 3833,
 740        "julien quesne" => 4654,
 741        "brett quigley" => 363,
 742        "alvaro quiros" => 3668,
 743        "siddikur rahman" => 5773,
 744        "richie ramsay" => 1782,
 745        "jyoti randhawa" => 1096,
 746        "jeff rangel" => 6149,
 747        "nathaniel rau" => 9083,
 748        "chez reavie" => 769,
 749        "jake redman" => 4180,
 750        "patrick reed" => 5579,
 751        "zack reeves" => 6904,
 752        "jean-francois remesy" => 870,
 753        "cory renfrew" => 6935,
 754        "danny renfro" => 5888,
 755        "lee rhind" => 5735,
 756        "clark richardson" => 6003,
 757        "jerry richardson, jr." => 5681,
 758        "brian ricketts" => 6765,
 759        "tag ridings" => 982,
 760        "chris riley" => 372,
 761        "george riley" => 5889,
 762        "dustin risdon" => 2941,
 763        "robert rock" => 1494,
 764        "patrick rodgers" => 6825,
 765        "carlos rodiles" => 1495,
 766        "tyler rody" => 6955,
 767        "jason roets" => 5890,
 768        "jamie rogers" => 1278,
 769        "john rollins" => 709,
 770        "andres romero" => 1712,
 771        "martin rominger" => 1629,
 772        "jake roos" => 3280,
 773        "justin rose" => 569,
 774        "chris ross" => 5586,
 775        "marco ruiz" => 1123,
 776        "mike ruiz" => 1351,
 777        "brett rumford" => 570,
 778        "dave rummells" => 571,
 779        "raymond russell" => 882,
 780        "santiago russi" => 4184,
 781        "rory sabbatini" => 377,
 782        "david saka" => 5861,
 783        "elliot saltman" => 4714,
 784        "lloyd saltman" => 1531,
 785        "alberto sanchez" => 6803,
 786        "david sanchez" => 1714,
 787        "jarmo sandelin" => 378,
 788        "ricardo santos" => 4187,
 789        "jake sarnoff" => 6941,
 790        "reinier saxton" => 3834,
 791        "paul scaletta" => 5755,
 792        "wilhelm schauman" => 1532,
 793        "neil schietekat" => 5095,
 794        "phil schmitt" => 1394,
 795        "jason schmuhl" => 4213,
 796        "steve schneiter" => 626,
 797        "dave schultz" => 3247,
 798        "jesse schutte" => 6611,
 799        "charl schwartzel" => 1097,
 800        "zane scotland" => 4401,
 801        "adam scott" => 388,
 802        "john senden" => 710,
 803        "tom shadbolt" => 5850,
 804        "sean shahi" => 6612,
 805        "mark sheftic" => 4786,
 806        "nick sherwood" => 6804,
 807        "kevin shields" => 1168,
 808        "conrad shindler" => 7160,
 809        "wes short, jr." => 758,
 810        "marcel siem" => 1336,
 811        "mark silvers" => 5503,
 812        "webb simpson" => 1614,
 813        "jeev milkha singh" => 629,
 814        "vijay singh" => 392,
 815        "geoffrey sisk" => 1066,
 816        "joel sjoholm" => 4214,
 817        "patrik sjoland" => 490,
 818        "david skinns" => 3257,
 819        "lee slattery" => 1498,
 820        "cody slover" => 5923,
 821        "mike small" => 476,
 822        "andy smith" => 6048,
 823        "jesse smith" => 3704,
 824        "nathan smith" => 5035,
 825        "sam smith" => 5985,
 826        "stuart smith" => 1370,
 827        "brandt snedeker" => 1222,
 828        "joey snyder iii" => 1362,
 829        "pierre-henri soero" => 1425,
 830        "greg sonnier" => 963,
 831        "shunsuke sonoda" => 5556,
 832        "jeff sorenson" => 6157,
 833        "bob sowards" => 631,
 834        "jordan spieth" => 5467,
 835        "thammanoon sriroj" => 1534,
 836        "kevin stadler" => 860,
 837        "scott stallings" => 3378,
 838        "nathan stamey" => 4614,
 839        "jon stanley" => 4815,
 840        "kyle stanley" => 1778,
 841        "iain steel" => 943,
 842        "brendan steele" => 3596,
 843        "shawn stefani" => 4643,
 844        "henrik stenson" => 576,
 845        "richard sterne" => 1499,
 846        "tim stewart" => 4644,
 847        "darron stiles" => 984,
 848        "drew stoltz" => 3735,
 849        "john stoltz" => 7126,
 850        "graeme storm" => 1500,
 851        "ben stow" => 9038,
 852        "scott strange" => 3836,
 853        "robert streb" => 5619,
 854        "kevin streelman" => 1077,
 855        "paul streeter" => 5554,
 856        "steve stricker" => 412,
 857        "chris stroud" => 1352,
 858        "sven struver" => 1212,
 859        "brian stuard" => 3599,
 860        "miguel suarez" => 3684,
 861        "chip sullivan" => 414,
 862        "daniel summerhays" => 3452,
 863        "anthony summers" => 3662,
 864        "russell surber" => 3810,
 865        "steve surry" => 4715,
 866        "kevin sutherland" => 417,
 867        "adam svensson" => 9127,
 868        "matthew swan" => 6061,
 869        "miguel tabuena" => 6266,
 870        "tadahiro takayama" => 1536,
 871        "toru taniguchi" => 422,
 872        "hideto tanihara" => 1099,
 873        "nick taylor" => 3792,
 874        "vaughn taylor" => 1185,
 875        "josh teater" => 1568,
 876        "justin thomas" => 4848,
 877        "michael thompson" => 3688,
 878        "nicholas thompson" => 1586,
 879        "ryan thompson" => 4198,
 880        "marius thorp" => 1704,
 881        "guan tianlang" => 7165,
 882        "steven tiley" => 1307,
 883        "michael tobiason, jr." => 6020,
 884        "brendon todd" => 3454,
 885        "gator todd" => 6613,
 886        "derek tolan" => 819,
 887        "david toms" => 429,
 888        "aaron townsend" => 3663,
 889        "d.j. trahan" => 431,
 890        "martin trainer" => 6151,
 891        "manuel trappel" => 6201,
 892        "jose trauwitz" => 3631,
 893        "cameron tringale" => 4645,
 894        "ty tryon" => 434,
 895        "yoshinobu tsukada" => 1295,
 896        "miles tunnicliff" => 1296,
 897        "marc turnesa" => 3283,
 898        "yui ueda" => 8959,
 899        "peter uihlein" => 1674,
 900        "gus ulrich" => 3775,
 901        "inigo urquizu" => 5877,
 902        "jean van de velde" => 439,
 903        "bo van pelt" => 712,
 904        "mike van sickle" => 4709,
 905        "jaco van zyl" => 1762,
 906        "nicolas vanhootegem" => 583,
 907        "harold varner, iii" => 6991,
 908        "bradford vaughan" => 584,
 909        "grant veenstra" => 5051,
 910        "jhonattan vegas" => 1030,
 911        "scott verplank" => 441,
 912        "mads vibe-hastrup" => 1501,
 913        "camilo villegas" => 1264,
 914        "t.j. vogel" => 7127,
 915        "doug wade" => 6902,
 916        "john wade" => 1538,
 917        "johnson wagner" => 1265,
 918        "simon wakefield" => 1706,
 919        "andy walker" => 6667,
 920        "jimmy walker" => 446,
 921        "sam walker" => 1502,
 922        "anthony wall" => 1129,
 923        "darren wallace" => 1343,
 924        "paul waring" => 3474,
 925        "marc warren" => 4276,
 926        "aaron watkins" => 1379,
 927        "nick watney" => 1042,
 928        "bubba watson" => 780,
 929        "tom watson" => 449,
 930        "romain wattel" => 5538,
 931        "michael weaver" => 6711,
 932        "kane webber" => 1725,
 933        "steve webster" => 1539,
 934        "boo weekley" => 713,
 935        "mike weir" => 453,
 936        "ross wellington" => 1707,
 937        "liang wen-chong" => 1724,
 938        "leif westerberg" => 1503,
 939        "lee westwood" => 455,
 940        "riley wheeldon" => 8930,
 941        "peter whiteford" => 4381,
 942        "michael whitehead" => 6021,
 943        "tom whitehouse" => 892,
 944        "trent whitekiller" => 5669,
 945        "oliver whiteley" => 1504,
 946        "dale whitnell" => 4419,
 947        "charlie wi" => 925,
 948        "martin wiegele" => 3838,
 949        "bernd wiesberger" => 4317,
 950        "danny willett" => 4304,
 951        "andrew willey" => 1309,
 952        "chris williams" => 4756,
 953        "lee williams" => 1426,
 954        "peter williamson" => 7143,
 955        "cameron wilson" => 6805,
 956        "dean wilson" => 459,
 957        "mark wilson" => 479,
 958        "oliver wilson" => 1506,
 959        "thaworn wiratchant" => 1588,
 960        "casey wittenberg" => 822,
 961        "eugene wong" => 5587,
 962        "clayton wonnell" => 7151,
 963        "chris wood" => 3839,
 964        "tim wood" => 3645,
 965        "joshua wooding" => 5230,
 966        "gary woodland" => 3550,
 967        "tiger woods" => 462,
 968        "jay woodson" => 3957,
 969        "rick woodson" => 5987,
 970        "adam wootton" => 6049,
 971        "chase wright" => 7039,
 972        "gareth wright" => 6177,
 973        "michael wright" => 1708,
 974        "a-shun wu" => 4456,
 975        "wei-huang wu" => 4430,
 976        "y.e. yang" => 1350,
 977        "azuma yano" => 1749,
 978        "simon yates" => 1579,
 979        "chan yih-shin" => 4973,
 980        "hao yuan" => 4438,
 981        "fabrizio zanotti" => 1770,
 982        "andy zhang" => 6810,
 983        "lian-wei zhang" => 1223,
 984        "xin-jun zhang" => 4479,
 985        "matthew zions" => 3476,
 986        "ryan zylstra" => 9035,
 987    }
 988);
 989
 990# Transform %leagues into player => { league => "league_name", id => id_number }
 991# to keep %leagues in a friendly/dry form, but keep fast lookups. This only
 992# executes once.
 993my %players;
 994for my $league (keys %leagues) {
 995    for my $player (keys %{$leagues{$league}}) {
 996        $players{$player} = +{
 997            id => $leagues{$league}{$player},
 998            league => $league,
 999        };
1000    }
1001}
1002
1003triggers any => keys %players;
1004
1005spice to => 'http://api.espn.com/v1/sports/golf/$1/$2/$3/$4'
1006            . '?enable=stats,competitors,roster,venues&$5='
1007            . (localtime->year() + 1900)
1008            . '&apikey={{ENV{DDG_SPICE_ESPN_APIKEY}}}&callback=$6';
1009
1010spice from => '(.*)/(.*)/(.*)/(.*)/(.*)/(.*)';
1011
1012handle query_lc => sub {
1013    return $players{$_}{league}, "athletes", $players{$_}{id}, "foo", "bar", "ddg_spice_espn";
1014};
1015
10161;