本文整理汇总了Python中stravalib.client.Client.get_related_activities方法的典型用法代码示例。如果您正苦于以下问题:Python Client.get_related_activities方法的具体用法?Python Client.get_related_activities怎么用?Python Client.get_related_activities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stravalib.client.Client
的用法示例。
在下文中一共展示了Client.get_related_activities方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Client
# 需要导入模块: from stravalib.client import Client [as 别名]
# 或者: from stravalib.client.Client import get_related_activities [as 别名]
#396462307 - Epping Club Ride
client = Client(access_token='250d33ceabfbe833376eb18885e797af14888512')
athlete = client.get_athlete() # Get John's full athlete record
print("Hello, {}. I know your email is {}".format(athlete.firstname, athlete.email))
# "Hello, John. I know your email is [email protected]"
activity_id = activity_ids[0] # The first ID is the root which we find the others
activity = client.get_activity(activity_id)
print (activity)
related_activities = client.get_related_activities(activity_id, limit=None)
print (related_activities)
for ra in related_activities:
print ra
activity_ids.append(ra.id)
print activity_ids
for activity_id in activity_ids:
act = client.get_activity(activity_id)
print act.name, act.type, act.athlete.firstname, act.athlete.lastname
if (act.gear == None and act.calories == None):
print 'Summary Activity'
else:
print 'Detailed Activity'