npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strava-bulk-edit

v1.0.9

Published

A plugin to add bulk editing to activities on Strava.com.

Downloads

38

Readme

strava-bulk-edit

2018-12-07 Update: This no longer works with the latest updates to the Strava site.

Build Status js-standard-style

What is this?

I really wanted bulk editing for my 224 Strava activities so I could make them all public. It started as simple script I wrote in the browser console and ended up as this.

Installation

Currently the only way to use this is to load it in the console of Strava.com. This must be done after any page changing navigation since a browser reload will clear any external scripts.

This is just a quick WIP for now, in the future there will be a better installation process, if I deem this useful enough.

> jQuery.getScript('https://unpkg.com/[email protected]/dist/StravaBulkEdit.js')

Usage

Loading the script will do the following:

  • Create window.StravaBulkEdit containing the API methods
  • Attach any necessary DOM elements to the current page

Training Page Bulk Editing

On the training page, it will add a dropdown to edit all activities to either public or private. It will do this by iterating over each one on the current page, and when it reaches the end of the page, navigating to the next page and starting over. It will also add a Cancel button while it's happening to abort any remaming activities.

Or you can use the API to edit any part of the row using some JS in the console.

// $row is always is a jQuery object
StravaBulkEdit.editAll({
  // Run the action that you want to perform on each activity row
  action: function ($row) {
    // e.g. Set the description of each row to "Big climb!"
    $row.find('[name=description]').val('Big climb!');
  },
  // Optionally, only run the action on certain rows, by default, the action will
  // run for all rows. Return true or false from this to determine if the activity
  // row should have the action peformed on it.
  condition: function ($row) {
    // e.g. Only set the description if the elevation is more than 1000
    var elevation = $row.find('li:contains(Elevation)').text().replace(/\D/g, '');
    return parseInt(elevation, 10) > 1000;
  }
})

Training Log Totals

On the training log page, it will add a button above the months nav which will auto-click through all the months to load the available data. After that, it will log an array of all available weeks with data for elevation, miles, and time. Note that this info will be available in the JS console.

Each time you run this it will save the latest fetched data to localStorage and use that as the earliest date next time.

Or you can use the JS API:

StravaBulkEdit.totalActivityLog({
  // Optional week interval to set as the earliest week to get data for
  // If left out, will use the value from the last run from localStorage
  earliestInterval: '2017y21w'
})
// Output
//  [{"interval":"2017y30w","week":30,"year":2017,"miles":19.7,"time":199,"elevation":2096}, ...]
//  Found 10 weeks from 2017y21w to 2017y30w

So this method doesn't have anything to do with bulk editing, but I figured I'd add it to this package. I might get around to changing the name of this package later, but probably not.

Disclaimer

This is in not affiliated with Strava, Inc. in any way. The term STRAVA and the Strava logo are the exclusive trademarks of, and are owned by, Strava Inc.

LICENSE

MIT