Created
May 1, 2012 07:39
-
-
Save dbr/2565986 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 4. John Van Seters (253%) | |
| The Basin, VIC, Australia | |
| 17. Guido G. (196%) | |
| Perth, WA, Australia | |
| 21. Jason E. (188%) | |
| Sydney, NSW, Australia | |
| 25. Ernie Pekar (175%) | |
| Sydney, NSW, Australia | |
| 38. Roger Hawley (157%) | |
| Jindalee, QLD, Australia | |
| 50. Brett Stuart (149%) | |
| Gold Coast, QLD, Australia | |
| 56. Alejandro Jimenez (147%) | |
| Medellin, Colombia, Australia | |
| 57. Andrew L. (146%) | |
| Brisbane, Queensland, Australia | |
| 59. Fergus Sully (144%) | |
| Nunawading, VIC, Australia | |
| 67. Springs Louie - BRC (141%) | |
| Brisbane, QLD, Australia | |
| 71. john eden (140%) | |
| Kalamunda, WA, Australia | |
| 76. Timmo C. (138%) | |
| Adelaide, SA, Australia | |
| 103. Matthew Flint (130%) | |
| Adelaide, SA, Australia | |
| 105. Paul Cavallin (130%) | |
| SA, Australia | |
| 110. Hans Geissler (129%) | |
| Pullenvale, QLD, Australia | |
| 114. Alex McCallum (128%) | |
| Melbourne, VIC, Australia | |
| 124. Craig M. (126%) | |
| QLD, Australia | |
| 132. Trevor Spencer (125%) | |
| Melbourne, VIC, Australia | |
| 137. tom ryan (124%) | |
| Kensington Gardens, SA, Australia | |
| 158. Fat Rider (Fat Man) (121%) | |
| Orange, NSW, Australia | |
| 164. Miguel Batista (120%) | |
| Brisbane, Queensland, Australia | |
| 181. Johnathan M. (119%) | |
| Newcastle, New South Wales, Australia | |
| 187. Darren C. (118%) | |
| Brisbane, QLD, Australia | |
| 189. Jurien D. (118%) | |
| Melbourne, VIC, Australia | |
| 191. Belle Caruso (118%) | |
| Tarragindi, QLD, Australia | |
| 198. Ross March (117%) | |
| Cairns, QLD, Australia | |
| 202. Swiss T. (116%) | |
| Canberra, ACT, Australia | |
| 212. James Fox (116%) | |
| Adelaide, SA, Australia | |
| 224. Trent Morey (114%) | |
| Melbourne, VIC, Australia | |
| 227. Tim Marsh (114%) | |
| Meerschaum Vale, NSW, Australia | |
| 231. Single S. (114%) | |
| Adelaide, SA, Australia | |
| 233. Denis Giles (114%) | |
| Mt Compass, SA, Australia | |
| 240. Alex Cashmore (113%) | |
| Adelaide, SA, Australia | |
| 245. Rob Wood (113%) | |
| Eastwood, SA, Australia | |
| 249. Kevin Bristow (113%) | |
| Bangalee, NSW, Australia | |
| 254. Feltman "ツーキニスト"Chuson (112%) | |
| Ryde, New South Wales, Australia | |
| 258. Michael C. (112%) | |
| Brisbane, QLD, Australia | |
| 261. Magpie S. (112%) | |
| Brisbane, QLD, Australia | |
| 271. Matthew A. (111%) | |
| Adelaide, SA, Australia | |
| 276. Sam E. (110%) | |
| Melbourne, VIC, Australia | |
| 282. Ian Franzke (110%) | |
| Mt Beauty, VIC, Australia | |
| 289. James Lacey (110%) | |
| Yackandandah, VIC, Australia | |
| 295. Meg C. (110%) | |
| QLD, Australia | |
| 301. loose cannon (109%) | |
| Balgowlah Heights, NSW, Australia | |
| 306. John O'Connell (109%) | |
| Pymble, NSW, Australia | |
| 311. Nathan Ellis (109%) | |
| Avalon, NSW, Australia | |
| 322. Jon Douglas (108%) | |
| Brisbane, QLD, Australia | |
| 329. Paul Schirmer (108%) | |
| Ferntree Gully, VIC, Australia | |
| 330. Jarrod Peck (108%) | |
| Melbourne, VIC, Australia | |
| 349. David H. (107%) | |
| Melbourne, VIC, Australia | |
| 365. brodie talbot (107%) | |
| Harrington Park, New South Wales, Australia | |
| 371. Adam B. (106%) | |
| Brisbane, QLD, Australia | |
| 372. Tim S. (106%) | |
| Albury, NSW, Australia | |
| 373. Damien Taylor (106%) | |
| Brisbane, QLD, Australia | |
| 374. Marc Durdin (106%) | |
| Hobart, TAS, Australia | |
| 381. Rohan S. (106%) | |
| Melbourne, VIC, Australia | |
| 390. Steven Ellison (106%) | |
| Adelaide, SA, Australia | |
| 399. Mitchell H. (105%) | |
| Sutherland, NSW, Australia | |
| 404. Vaughan Bowman (105%) | |
| Melbourne, VIC, Australia | |
| 416. Tony B. (104%) | |
| Kellyville Ridge, NSW, Australia | |
| 418. Peter Rabbit (104%) | |
| Bridgewater, SA, Australia | |
| 422. Tony Rush (104%) | |
| Brisbane, QLD, Australia | |
| 425. Jo R. (104%) | |
| Brisbane, QLD, Australia | |
| 443. Robin Brown (103%) | |
| Melbourne, Victoria, Australia | |
| 444. Sato Ueda (103%) | |
| Joondanna, WA, Australia | |
| 447. Mark C. (103%) | |
| Upper Sturt, SA, Australia | |
| 456. Flash G. (103%) | |
| Pymble, New South Wales, Australia | |
| 464. wood cutter (102%) | |
| Mornington, VIC, Australia | |
| 475. Norman K. (102%) | |
| Narrabeen, NSW, Australia | |
| 478. Simon Cleverley (102%) | |
| Canberra, ACT, Australia | |
| 487. Marty S. (102%) | |
| Newcastle, NSW, Australia | |
| 489. Clint Maddock (102%) | |
| Sydney, NSW, Australia | |
| 493. Jason Agius (102%) | |
| Currumbin, Queensland, Australia | |
| 499. Roy H. (101%) | |
| QLD, Australia | |
| 502. Shaun O'Callaghan (101%) | |
| North Adelaide, South Australia, Australia | |
| 513. Dave Drummond (101%) | |
| Brisbane, QLD, Australia | |
| 515. James Burns (101%) | |
| Melbourne, VIC, Australia | |
| 517. Ben B. (101%) | |
| Hyde Park, SA, Australia | |
| 518. Matt O. (101%) | |
| Canberra, ACT, Australia | |
| 523. Adam Honey (101%) | |
| Melbourne, VIC, Australia | |
| 525. Peter Williams (101%) | |
| Brisbane, QLD, Australia | |
| 540. John A. (101%) | |
| Tweed Heads, NSW, Australia | |
| 542. Michael Churchward (101%) | |
| Sydney, NSW, Australia | |
| 544. Ben W. (101%) | |
| Brisbane, QLD, Australia | |
| 546. Scott Y. (101%) | |
| Darlington, WA, Australia | |
| 551. James Woolcock (101%) | |
| Mitcham, VIC, Australia | |
| 552. Tim Lawes (101%) | |
| Melbourne, VIC, Australia | |
| 557. Jonno A. (101%) | |
| Halls Gap, VIC, Australia | |
| 559. Cam McDonald - Bike Gallery (101%) | |
| Melbourne, VIC, Australia | |
| 561. Dan Sowden (101%) | |
| Newman, WA, Australia | |
| 565. Ben D (100%) | |
| Adelaide, South Australia, Australia | |
| 570. Brit I. (100%) | |
| Melbourne, VIC, Australia | |
| 572. Stuart Neden (100%) | |
| Brisbane, QLD, Australia | |
| 582. Mark Feeney (100%) | |
| Moss Vale, NSW, Australia | |
| 587. Marcus D. (100%) | |
| Sydney, NSW, Australia | |
| 593. Craig L. (100%) | |
| Adelaide, SA, Australia | |
| 598. David Kerr (100%) | |
| Ferntree Gully, VIC, Australia | |
| 602. Phil Chapman (100%) | |
| Greenwich, NSW, Australia | |
| 605. Richard W. (100%) | |
| Gold Coast, QLD, Australia | |
| 607. Eamonn Bell (100%) | |
| Wollongong, NSW, Australia | |
| 622. Evan Snow (100%) | |
| Manly, NSW, Australia | |
| 623. Karl J. (100%) | |
| Brisbane, QLD, Australia | |
| 627. Nick Squillari (100%) | |
| Geelong, VIC, Australia | |
| 629. James Rickard (100%) | |
| Rosanna, VIC, Australia | |
| 643. Kieron Barnes (100%) | |
| Adelaide, SA, Australia | |
| 645. Evan J. (100%) | |
| Adelaide, SA, Australia | |
| 654. Mano' W. (100%) | |
| Belair, South Australia, Australia | |
| 659. Gary P. (100%) | |
| Mt Keira, NSW, Australia | |
| 668. Jason W. (100%) | |
| Brisbane, QLD, Australia | |
| 671. Michael Troy (100%) | |
| Orange, NSW, Australia | |
| 682. Chuck G. (100%) | |
| Melbourne, VIC, Australia | |
| 685. James Trevethick (100%) | |
| Melbourne, Victoria, Australia | |
| 112 completed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 76. Timmo C. (138%) | |
| Adelaide, SA, Australia | |
| 103. Matthew Flint (130%) | |
| Adelaide, SA, Australia | |
| 105. Paul Cavallin (130%) | |
| SA, Australia | |
| 137. tom ryan (124%) | |
| Kensington Gardens, SA, Australia | |
| 212. James Fox (116%) | |
| Adelaide, SA, Australia | |
| 231. Single S. (114%) | |
| Adelaide, SA, Australia | |
| 233. Denis Giles (114%) | |
| Mt Compass, SA, Australia | |
| 240. Alex Cashmore (113%) | |
| Adelaide, SA, Australia | |
| 245. Rob Wood (113%) | |
| Eastwood, SA, Australia | |
| 271. Matthew A. (111%) | |
| Adelaide, SA, Australia | |
| 390. Steven Ellison (106%) | |
| Adelaide, SA, Australia | |
| 418. Peter Rabbit (104%) | |
| Bridgewater, SA, Australia | |
| 447. Mark C. (103%) | |
| Upper Sturt, SA, Australia | |
| 517. Ben B. (101%) | |
| Hyde Park, SA, Australia | |
| 593. Craig L. (100%) | |
| Adelaide, SA, Australia | |
| 643. Kieron Barnes (100%) | |
| Adelaide, SA, Australia | |
| 645. Evan J. (100%) | |
| Adelaide, SA, Australia | |
| 17 completed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Shows a list of people in "SA, Australia" who completed http://app.strava.com/challenges/specialized-classic | |
| """ | |
| import urllib | |
| import time | |
| import json | |
| def get_challenge_page(page = 1, only_complete = True, cache = False): | |
| assert page > 0, "Pages start at 1" | |
| url = "http://app.strava.com/challenges/5/details?per_page=100&overall_page=%d" % (page) | |
| if cache: | |
| # geturl does much the same as the urllib.urlopen call, | |
| # but caches the return value in redis DB | |
| from common import geturl | |
| results = geturl(url) | |
| else: | |
| start = time.time() | |
| content = urllib.urlopen(url).read() | |
| end = time.time() | |
| print "%.02f seconds" % (end-start) | |
| results = json.loads(content) | |
| #goal_type = results['dimension'] # e.g elavation_gain | |
| goal_value = results['goal'] | |
| ret = [] | |
| for user in results['overall']: | |
| userinfo = results['athletes'][str(user['id'])] | |
| percentage = (userinfo['total_dimension'] / goal_value) * 100 | |
| if only_complete and percentage < 100: | |
| return ret | |
| else: | |
| ret.append({ | |
| 'percentage': percentage, | |
| 'name': userinfo['name'], | |
| 'location': userinfo['location'], | |
| 'rank': user['rank']}) | |
| return ret | |
| def show_user(u): | |
| print "%(rank)d. %(name)s (%(percentage)d%%)\n%(location)s" % u | |
| if __name__ == '__main__': | |
| all_results = [] | |
| for x in range(10): | |
| page = get_challenge_page(page=x+1, cache = False) | |
| if len(page) == 0: | |
| print "Done at page %d" % (x+1) | |
| break | |
| all_results.extend(page) | |
| counter = 0 | |
| for u in all_results: | |
| if 'SA, Australia'.lower() in u['location'].lower(): | |
| show_user(u) | |
| counter += 1 | |
| print "\n%d completed" % counter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment