How to use strava-v3 - 2 common examples

To help you get started, we’ve selected a few strava-v3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sujinleeme / data-visualization-experiments / src / component / api / stravaAPI.js View on Github external
const fs = require('fs')
const strava = require('strava-v3')

strava.athlete.listActivities({
	'per_page': 200
}, (err, payload, limits) => {
	if (!err) {
		console.log('start read save file')
		fs.writeFile('records.json', JSON.stringify(payload, null, 2), function (err) {
			if (err) return console.log(err)
			console.log('success save file')
		})
	}
	else {
		console.log(err);
	}
})
github mbmccormick / api / app / strava.js View on Github external
exports.getActivities = function(next) {
    
    var cachedResult = cache.get('strava.getActivities');
    if (cachedResult) {
        return q.fcall(function() {
            return cachedResult;
        });
    }
    
    var deferred = q.defer();
    
    strava.athlete.listActivities({ 'access_token': process.env.STRAVA_ACCESS_TOKEN }, function(err, response) {
        if (err) {
            deferred.reject(next(new Error('Failed to retrieve Strava activities')));
        }
        
        var payload = response;
        
        var data = [];
        for (var i = 0; i < payload.length; i++)
        {
            var item = payload[i];
            
            data.push({
                dateTime: new Date(item['start_date']),
                name: item['name'],
                type: item['type'],
                distance: item['distance'],

strava-v3

Simple wrapper for Strava v3 API

MIT
Latest version published 3 months ago

Package Health Score

68 / 100
Full package analysis

Popular strava-v3 functions