beaulebens / keyring-social-importers

A collection of importers which pull your content back from social networks, and into your own WordPress install.
32 stars 17 forks source link

Add more Strava types & fix polylines #27

Closed marekhrabe closed 5 years ago

marekhrabe commented 5 years ago

In this PR, I've added Swim and Walk types and I've also added saving this type into post meta field strava_type (used string directly from Strava so example values are Walk, Swim, Ride, …)

I've also noticed that polylines saved by the initial Strava importer are corrupted. Unfortunately the encoding uses slashes as proper characters and they were getting stripped. Other places online recommended using JSON stringification as a storage/transfer medium for the encoded polyline so I've implemented it that way (wp_slash( wp_json_encode ( $polyline ) )).

I've added a reprocessor to fix the polylines and added a mention of a polyline library that worked for me with the data.