glennreyes / runtastic-gpx

💪 Convert Runtastic JSON exports to GPX
https://runalyze.com/runtastic-converter
27 stars 11 forks source link

supporting other activities #3

Closed jmlucjav closed 5 years ago

jmlucjav commented 5 years ago

I would like to know what entails supporting other activities (most of which done have gps data (swim, pilates), and some do (mountain bike)).

I created a small script to see how many of my activites would be converted:

#!/bin/bash
MYTMP=$(mktemp)
# echo "Temp file: $MYTMP"

for FILEJSON in ../Sport-sessions/*.json; do
    type=`cat $FILEJSON | jq -c '.sport_type_id'`
    echo $type >> $MYTMP
    # echo $type 
done

echo "Count and activity ids:"
sort $MYTMP | uniq -c | sort -bgr

outputs something like:

Count and activity ids: 537 "18" 319 "34" 262 "31" 198 "23" 106 "4" 75 "1" 59 "27" 47 "3" 34 "5" 26 "7" 20 "19" 5 "15"

so I would like to get most of them covered. I am not proficient in js. thanks!

glennreyes commented 5 years ago

That would be neat! I'd be happy to merge your PR adding these activities.

Here's an example of how road bike was added: https://github.com/glennreyes/runtastic-gpx/pull/1

Thanks!

jmlucjav commented 5 years ago

Ok, I want to test my changes, but not sure why the new code is not run. I have zero experience with all this js stuff. Do I need to do something to make the modified code be picked up?

thanks

glennreyes commented 5 years ago

Yes, http://makeapullrequest.com/

jmlucjav commented 5 years ago

mmm, I guess I didn't explain clearly. I know how to make a PR here. But I would like to test my changes locally before sending the PR.

But if I just change index.js and run it, it runs as if no changes have been made. I am doing something wrong but no idea what....

glennreyes commented 5 years ago

You can go into the project folder and try running instead of node ./cli [export-path] [output-path] instead. (Make sure to make cli executable with chmod).

Does this help?

jmlucjav commented 5 years ago

no, I get weird errors:

C:\temp\runtastic-gpx-master>node ./cli c:\temp c:\out                                         
internal/modules/cjs/loader.js:628                                                             
    throw err;                                                                                 
    ^                                                                                          

Error: Cannot find module 'meow'                                                               
Require stack:                                                                                 
- C:\temp\runtastic-gpx-master\cli.js                                                          
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)←[39m      
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:527:27)←[39m                 
←[90m    at Module.require (internal/modules/cjs/loader.js:683:19)←[39m                        
←[90m    at require (internal/modules/cjs/helpers.js:16:16)←[39m                               
    at Object.<anonymous> (C:\temp\runtastic-gpx-master\cli.js:4:14)                           
←[90m    at Module._compile (internal/modules/cjs/loader.js:777:30)←[39m                       
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)←[39m         
←[90m    at Module.load (internal/modules/cjs/loader.js:643:32)←[39m                           
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:556:12)←[39m                 
←[90m    at Function.Module.runMain (internal/modules/cjs/loader.js:840:10)←[39m {             
  code: ←[32m'MODULE_NOT_FOUND'←[39m,                                                          
  requireStack: [ ←[32m'C:\\temp\\runtastic-gpx-master\\cli.js'←[39m ]                         
}                                             

Anyway, I'll send the PR as is, the patch is simple enough... thanks

mipapo commented 5 years ago

Foound something:

 <option value="53">Back Country Skiing</option>
 <option value="24">Badminton</option>
 <option value="68">Baseball</option>
 <option value="45">Basketball</option>
 <option value="60">Biathlon</option>
 <option value="32">Climbing</option>
 <option value="8">Cross Country Skiing</option>
 <option value="69">Crossfit</option>
 <option value="37">Cross Skating</option>
 <option value="58">Curling</option>
 <option value="3">Cycling</option>
 <option value="50">Diving</option>
 <option value="12">Driving</option>
 <option value="49">Freecrossen</option>
 <option value="33">Frisbee</option>
 <option value="21">Golfing</option>
 <option value="36">Handbike</option>
 <option value="7">Hiking</option>
 <option value="71">Ice Hockey</option>
 <option value="54">Ice Skating</option>
 <option value="59">Ice Stock</option>
 <option value="44">Kayaking</option>
 <option value="61">Kite Skiing</option>
 <option value="43">Kite Surfing</option>
 <option value="11">Motorbiking</option>
 <option value="4">Mountain Biking</option>
 <option value="2">Nordic Walking</option>
 <option value="5">Other</option>
 <option value="47">Paragliding</option>
 <option value="22">Race Cycling</option>
 <option value="20">Riding</option>
 <option value="17">Rowing</option>
 <option value="75">Rugby</option>
 <option value="1" selected="selected">Running</option>
 <option value="29">Sailing</option>
 <option value="72">Skateboarding</option>
 <option value="6">Skating</option>
 <option value="9">Skiing</option>
 <option value="41">Nordic Cross Skating</option>
 <option value="55">Sledding</option>
 <option value="39">Smovey Walking</option>
 <option value="57">Snowball Fight</option>
 <option value="10">Snow Boarding</option>
 <option value="56">Snowman Building</option>
 <option value="13">Snowshoeing</option>
 <option value="38">Soccer</option>
 <option value="62">Speed Skiing</option>
 <option value="76">Standup Paddling</option>
 <option value="19">Walking</option>
 <option value="42">Surfing</option>
 <option value="18">Swimming</option>
 <option value="23">Tennis</option>
 <option value="35">Volleyball</option>
 <option value="48">Wake Boarding</option>
 <option value="30">Windsurfing</option>

I will create a PR

glennreyes commented 5 years ago

Woah, that's sick @mipapo 👏

glennreyes commented 5 years ago

This is fixed by #5

jmlucjav commented 5 years ago

nice @mipapo I still am wondering wtf is 27 (the one I could not identify). Where did you find this? Their web version is removed...

mipapo commented 5 years ago

@jmlucjav The import is still available in the web ;) but there is no "27"