当前位置: 首页>>代码示例>>Python>>正文


Python Client.get_related_activities方法代码示例

本文整理汇总了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'
开发者ID:mrkarlos,项目名称:strava_club,代码行数:33,代码来源:cs_speed.py


注:本文中的stravalib.client.Client.get_related_activities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。