This file contains 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
import requests | |
import json | |
from pprint import pprint | |
#replace YOUR_API_KEY with your key | |
apikey = 'YOUR_API_KEY' | |
url = 'https://api.triathlon.org/v1/statistics/results?' | |
query = 'analysis=count_unique&target_property=event.name&group_by=event.name|program.id|program.name' | |
local_filename = 'test.txt' |
This file contains 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
curl - header "apikey: YOUR_APP_KEY" "https://api.triathlon.org/v1/statistics/results?analysis=count_unique&target_property=event.name&group_by=event.name|program.id|program.name" |
This file contains 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
import requests | |
import json | |
from pprint import pprint | |
apikey = 'YOUR_API_KEY' | |
url = 'https://api.triathlon.org/v1/statistics/results?' | |
query = "analysis=minimum&target_property=position&filters=program.id,eq,{0}&group_by=athlete.name|athlete.id|program.start_time|program.wetsuit|splits.swim|splits.swim_distance|splits.bike|splits.bike_distance|splits.run|splits.run_distance|splits.t1|splits.t2|temperature.air|temperature.water|format|event.id|event.country|event.venue|finish_time" | |
local_filename = 'test.txt' | |
params = {} |
This file contains 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
with open(local_filename, 'wb') as f: | |
for chunk in r.iter_content(chunk_size=1024): | |
if chunk: # filter out keep-alive new chunks | |
f.write(chunk) |
This file contains 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
import requests | |
import json | |
from pprint import pprint | |
apikey = 'YOUR_API_KEY' | |
url = 'https://api.triathlon.org/v1/athletes/' | |
query = '{0}?output=basic' | |
local_filename = 'test.txt' | |
params = {} |
This file contains 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
render() { | |
return ( | |
<Fragment> | |
<ChildA /> | |
<ChildB /> | |
<ChildC /> | |
</Fragment> | |
); | |
} |
This file contains 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
render() { | |
return ( | |
<React.Fragment> | |
<ChildA /> | |
<ChildB /> | |
<ChildC /> | |
</React.Fragment> | |
); | |
} |
This file contains 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
function getStepContent(step) { | |
switch (step) { | |
case 0: | |
return <AddressForm />; | |
case 1: | |
return <PaymentForm />; | |
case 2: | |
return <Review />; | |
default: | |
throw new Error('Unknown step'); |
This file contains 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
class Checkout extends Component { | |
state = { | |
activeStep: 0, | |
addressForm: { | |
firstName: '', | |
lastName: '', | |
address1: '', | |
address2: '', | |
city: '', | |
state: '', |
This file contains 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
handleChange = (name, area) => event => { | |
const value = event.target.value; | |
this.setState({ | |
[area]: { | |
...this.state[area], | |
[name]: value | |
} | |
}); | |
} |
OlderNewer