node-red-web-nodes icon indicating copy to clipboard operation
node-red-web-nodes copied to clipboard

Strava fitness nodes

Open zobalogh opened this issue 10 years ago • 0 comments
trafficstars

Introduction

We'd like to support three possible scenarios with the Strava fitness node initially:

* Use case 1 (current priority focus): Poll the authenticated user's activities and get details for the most recently uploaded activity => Can be used in flows that check if the user has indeed done scheduled (Google Calendar) activity. If the user has not done activity, certain actions can be taken (re-schedule activity, send text message to coach, notify user to upload activity, etc.)

* Use case 2: I'm in a new location, I would like to get segments for the nearby area. This is to be used in Location-based flows to find new exercise routes in an unknown area. => Problem is that segments are NOT actual routes. Routes cannot be retrieved using Strava.

* Use case 3: Get activities of friends. => Could be used for route finding in a very complicated, unnatural way. => Get activities of friends => Check location of activity => If near current location, use as recommendation?

Get Activities for authenticated user:

http://strava.github.io/api/v3/activities/#get-activities

Get details on activity:

http://strava.github.io/api/v3/activities/#get-details

Get Segments in given area:

http://strava.github.io/api/v3/segments/#explore

Retrieve details for a given segment:

http://strava.github.io/api/v3/segments/#retrieve

Input Node

Can be used to send out initial message if:

  • Authenticated user creates a brand new activity (initial focus)
  • Friends of authenticated user creates a new activity (won't implement this under this issue)
    • node options:
  • NONE! There's no need. Simply keep getting latest activity, see if activity ID changes. Then send out message with the activity's details.

Query Node

Activity mode:

Can be used to query the most recent activity of:

  • The authenticated user (intial focus)
  • Or the most recent activiti(es) uploaded by the user's friends (won't implement under this issue)

Segment mode:

  • Provide location => Get segment(s)
  • Get details for all/a particular segment
    • node options:
  • Mode: Segment mode/Activity mode
  • Location: Usual data, only useful for segment mode
  • Number of items to return: Whether to return a single (most recent) activity/segment or more.

OAuth is used to authenticate user with Strava.

To be added to credentials as usual.

http://strava.github.io/api/#access

zobalogh avatar Nov 28 '14 16:11 zobalogh