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

Download tasks from Soaringspot #1419

Open
LWEdslev opened this issue May 2, 2024 · 14 comments
Open

Download tasks from Soaringspot #1419

LWEdslev opened this issue May 2, 2024 · 14 comments
Assignees

Comments

@LWEdslev
Copy link

LWEdslev commented May 2, 2024

XCSoar version

7.42 android

What should XCSoar do differently, what functionality should be added?

I would like to click a button and then the task for the selected competition would be downloaded, enabled and declared (if logger is connected).

What are you trying to do, what is the use case for the suggestion?

On a competition morning, it is nice if I don't have to type the task in by hand

@lordfolken
Copy link
Contributor

lordfolken commented May 3, 2024

There is @kedder s openvario menu that does that.

@DanD222
Copy link
Contributor

DanD222 commented May 3, 2024

“compman”, specifically https://github.com/kedder/openvario-compman, but that’s intended for Openvario use outside of XCSoar.

Another vector to get a task into XCSoar is to link your WeGlide account with XCSoar, declare your competition task to WeGlide, and then download that in XCSoar.

But yes, it’d still be nice if XCSoar could download a Soaringspot task on its own.

@kobedegeest
Copy link
Contributor

They have public api: http://download.naviter.com/soaringspot/api/index.html
This would indeed be nice feature to have.

@lordfolken
Copy link
Contributor

Any takers?

@LWEdslev
Copy link
Author

LWEdslev commented May 5, 2024

I could try but need some help with questions since I haven't done any contributions to XCSoar and have limited C++ experience

@LWEdslev
Copy link
Author

LWEdslev commented May 6, 2024

I thought only POST in the API needed an API key but apparently the GET requests also do so all I get is 401.
"In order to access the data you need an AppID and a secret key. You can generate those by going to the “Edit Competition > API Key” page."
Any ideas on how to handle this?

@DanD222
Copy link
Contributor

DanD222 commented May 6, 2024

Only advice I can give is maybe have a look at the Compman code to see if you find anything useful there.

@LWEdslev
Copy link
Author

LWEdslev commented May 6, 2024

Hmmm, seems like compman doesn't use the API but just goes to the soaringspot homepage and does some web scraping.

@kobedegeest
Copy link
Contributor

All examples i found of getting soaringspot data use HTTP requests instead of the API (compman to i believe)

So you can just make a test competition and get an API key and secret but even then i do not know how to get it to work.
The api claims you can use https://api.soaringspot.com/browser/#/v1 to browes the api responses but i tried this with api key and secret generated from a simple test competition but no luck.

Maybe you could just contact naviter? And ask them how their api is intended to be used.

@Plantain
Copy link
Contributor

Plantain commented May 6, 2024 via email

@kobedegeest
Copy link
Contributor

Update: i did manage to get something out of that hall browser (even without the api key)
so in the Explorer bar where it pre fills "/v1" if you put there /url_comp with url_comp the part of the soaringspot url with name and location it returns stuff for example /test-overboelare-2024 (this is test comp i made)

But it seems not all competitions work so maybe the competition needs to have made an api key to enable acces via the api.

@LWEdslev
Copy link
Author

LWEdslev commented May 6, 2024

I have written an e-mail to Naviter about how we should proceed with their API

@kedder
Copy link
Member

kedder commented May 6, 2024

Naviter API is not very usable for this purpose, because there's no public API and one needs an account (with the key) to use it. At least that was the case when I looked at it few years ago.

The way compan downloads a task is by using another web service, https://soarscore.com to download tasks. Soarscore in turn just parses HTML with the task description on soaringspot.

@styblope
Copy link
Contributor

styblope commented May 14, 2024

GlideAndSeek also provide a nice public translation service API:
https://api.glideandseek.com/v2/task?url=<soaringspot_task_url>

Task data JSON interface documentation:
https://glideandseek.com/about/interfaces/task-data-interface

[edit]
Soarscore provides tasks in XML format compliant with XCSoar!

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

No branches or pull requests

7 participants