Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync to runalyze #300

Closed
piratenpanda opened this issue Aug 5, 2015 · 30 comments
Closed

Sync to runalyze #300

piratenpanda opened this issue Aug 5, 2015 · 30 comments

Comments

@piratenpanda
Copy link

I don't know if runalyze can import sync data but as it's also free software it would be nice if you could cooperate in some way :)

https://runalyze.com/login.php

@sporkbyspork
Copy link

This would be really great. By self-hosting Runalyze, you wouldn't need to give the data collected by Runnerup away to third parties.

@jonasoreland
Copy link
Owner

hmm...it seems this is also open source,
https://github.com/Runalyze/Runalyze
so it should be very doable to fix synchronization.

On Wed, Sep 2, 2015 at 11:13 AM, sporkbyspork notifications@github.com
wrote:

This would be really great. By self-hosting Runalyze, you wouldn't need to
give the data collected by Runnerup away to third parties.


Reply to this email directly or view it on GitHub
#300 (comment)
.

@lenucksi
Copy link

That would be splendid for the reasons @sporkbyspork named!
They appear to already support quite a number of sync services.
👍

@mipapo
Copy link

mipapo commented Dec 30, 2015

Should be no problem, when we have our API. Please stay tuned. We will inform you!

@RunningCl0ud
Copy link

I cross my fingers and hope you make it happen @mipapo 👍

@powellc
Copy link

powellc commented Feb 13, 2016

Anyone else working on this? Otherwise I've got a pull request coming in a few here.

@mipapo
Copy link

mipapo commented Feb 13, 2016

@powellc Without our API it will be just a dirty hack. So my recommendation is to wait for it ;)

@powellc
Copy link

powellc commented Feb 13, 2016

Yeah, after I posted that I took a look at Runalyze source and realized what I was up against! Also I haven't done PHP work in years so I don't trust myself to work on that codebase ... I'll wait. In the meantime, just getting gpx files in ownCloud would be awesome, so I'm working on that.

@Marx2
Copy link

Marx2 commented May 15, 2016

I've succesfully launched selfhosted runalyze site, and imported all my trainings from RunnerUp through gpx files (downloaded from Strava). It would be great to have it automated. And it would be great to integrate live positioning on the map during run with this webapp.

@Marx2
Copy link

Marx2 commented Jul 28, 2016

As their API doesn't seem to appear in a near feature, maybe it would be nice to implement so called "dirty solution"
referenced here:
https://github.com/Runalyze/Runalyze/issues/498
https://gist.github.com/mipapo/cafe45b0c2a247d9c0614bd2cc8fe4d0

@mipapo
Copy link

mipapo commented Jul 28, 2016

I'm not sure if it would be a great idea to do this.
I really try to get the basic API done by the end of the year.
Next RUNALYZE release will be 3.0 and I think we will just getting faster after that version in our development process. I'm getting more confident that we manage that this year

(By the way - with 2.x it's only possible to have one user authenticated on once device simultaneously - this will change with 3.0)

@rickyepoderi
Copy link
Contributor

Hi everyone,

I have implemented a very simple automatic synchronizer to runalyze. It is very simple and follows the ideas presented previously in this blog entry. The basics are quite simple:

  • A new auth method is created in order to let you change the connection URL (by default the public runalyze url is presented). I want to use my own runalyze.
  • A new format RunzalizePost parses the database and writes the enormous post data runalyze needs.
  • The synchronizer just uploads the activity (no more features).

There are some quirks with conversions of IDs, calories and so on but it works. The branch is my repo:

https://github.com/rickyepoderi/runnerup/tree/runalyze

I'm open to make changes or any other improvements (just I can't guarantee any schedule, sorry I have very little free time). When you agree I can submit a pull request.

Thanks!

@mipapo
Copy link

mipapo commented Aug 15, 2016

@rickyepoderi The URI won't work with the upcoming release (v3.0). activity/add instead of call/call.Training.create.php should be the new one
(everything else should be fine then - fyi: with version 3.0 a user can be now logged in with multiple devices at once)
It would be better if a tcx file could be "pushed" to RUNALYZE (Runalyze does the rest)

With the release of version 3.0 we are really coming closer to an official API.

@rickyepoderi
Copy link
Contributor

@mipapo We can change it later or check the two urls at connection time (when configuring username and password). But if v3.0 is going to have an API (I hope it's a restful WS api) we can redo the synchronizer then and adapt it properly to the new version, making it as full-featured as possible.

But the reality is that now it's impossible to upload my data to my own server, which annoys me a lot, I have to say.

@mipapo
Copy link

mipapo commented Aug 15, 2016

@rickyepoderi The API will come later with a version of 3.* (Not directly with 3.0) (Yes it will be a RESTFUL WS API)

@rickyepoderi
Copy link
Contributor

Fantastic! Then I think the better approach is trying to guess the URL when defining the synchronizer (try one, if 404 or something, the other). Later on, somebody should redo the synch for the API. Is there some alpha or beta for 3.0? Should I compile myself from current github?

@mipapo
Copy link

mipapo commented Aug 15, 2016

@rickyepoderi You could get a tester (write a mail to us). Latest master-dev package is available at dl.runalyze.com
Checkout the administration docs: https://docs.runalyze.com/en/latest/ (Also when you want to checkout directly from github)
@rickyepoderi Or just checkout the beta at https://svn.runalyze.com

@rickyepoderi
Copy link
Contributor

Ok, I have just prepared my synchronizer to detect v2 and v3. Finally v3 also changes the way to login (it seems that runalyze uses now a new framework and everything is a bit different), so finally with the login the synchronizer can detect if the version is 3.x or 2.x and then call proper URLs.

@mipapo Can you confirm the same post fields are used in both versions? I have uploaded five or six activities and no problem with the upload (just changing the URL they were uploaded successfully).

The changes are incorporated to my branch if you want to test.

@mipapo
Copy link

mipapo commented Aug 15, 2016

@mipapo Can you confirm the same post fields are used in both versions?

Yes!

@rickyepoderi
Copy link
Contributor

I have released a debug version in case you want to test (please do a backup before, this is at your own rick). I have tested with my own phone. I'd just test it and revert to the original app (restoring the backup). Here is the link:

https://github.com/rickyepoderi/runnerup/releases/tag/v1.54-alpha

Please connect to a runnalyze account (2.x and 3.x would be great) and import some activities. Remember that the URL should be changed if you want to test your own server (if your installation has a path, for example http://192.168.1.2/runalyze, you have to include the context too).

@rickyepoderi
Copy link
Contributor

Has somebody tested the release or checked the code changes?
Are you interested in this?
Is it ok if I submit a pull request?

@mipapo
Copy link

mipapo commented Sep 3, 2016

Just a feedback from my site: It's working for me

@jonasoreland
Copy link
Owner

pull request sounds like a good idea!!

On Sat, Sep 3, 2016 at 6:52 PM, Michael Pohl notifications@github.com
wrote:

Just a feedback from my site: It's working for me


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#300 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABYS1j-mhJ9t4YeZmG9aNRguuG7oOZEks5qmaXKgaJpZM4Fl2vD
.

jonasoreland added a commit that referenced this issue Sep 7, 2016
@Marx2
Copy link

Marx2 commented Jan 25, 2017

As we have Runalyze synchronization merged and working, shouldn't we close this task?

@craftyguy
Copy link

Something is off a bit. When I try to sync an activity in runnerup that is 'biking', it gets synced to runalyze as a running activity.

@rickyepoderi
Copy link
Contributor

@craftyguy Please open a new issue and be sure to include my name @rickyepoderi on it.

I always run (and I never cycling) so I personally have never tested another activity. In theory the column DB.ACTIVITY.SPORT from table Constants.DB.ACTIVITY.TABLE is read, transform into an Sport.valueOf(dbValue) and then if sport.isCycling() a 3 is returned. The magic 3 number is because in my ddbb was like this.

Please add to the bug if you are using your own server o the runalyze.com web.

@mipapo
Copy link

mipapo commented Apr 4, 2017

@rickyepoderi I think that "3" was your local sport id. You would need to read all the users sport names and map the sport name to your sport.isCycling() method.

By the way: The next version of Runalyze will have some configureable "fixed" sport types. So we are getting closer to an API

@gerhardol
Copy link
Collaborator

Mapping included in v1.58 (but upload fails for other reasons, new issue?)

@Marx2
Copy link

Marx2 commented Aug 9, 2017 via email

@gerhardol
Copy link
Collaborator

@Marx2 This issue was about synching to Runalyze
I suggest you open a new issue that clearly is about the planned upload API for future changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests