本文整理匯總了Python中stravalib.Client.get_athlete_followers方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.get_athlete_followers方法的具體用法?Python Client.get_athlete_followers怎麽用?Python Client.get_athlete_followers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類stravalib.Client
的用法示例。
在下文中一共展示了Client.get_athlete_followers方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from stravalib import Client [as 別名]
# 或者: from stravalib.Client import get_athlete_followers [as 別名]
def main():
assert len(args.athlete_ids) == len(args.access_tokens)
logger.info("app id: %i, fetching friends for ids %s" % \
(args.id_strava_app, str(args.athlete_ids)))
for i in range( len(args.access_tokens) ):
client = Client()
client.access_token = args.access_tokens[i]
athlete_id = args.athlete_ids[i]
time.sleep(TIME_PAUSE)
friends = [ friend.id for friend in client.get_athlete_friends() ]
time.sleep(TIME_PAUSE)
followers = [ follower.id for follower in client.get_athlete_followers() ]
add_friends_to_db(conn, athlete_id, friends, type="friend")
add_friends_to_db(conn, athlete_id, followers, type="follower")
logger.info("Done.")