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

Split we.go into backends and frontends #1

Closed
quite opened this issue Jan 27, 2015 · 8 comments
Closed

Split we.go into backends and frontends #1

quite opened this issue Jan 27, 2015 · 8 comments

Comments

@quite
Copy link

quite commented Jan 27, 2015

Suggestions: support http://openweathermap.org/api

@schachmat
Copy link
Owner

As far as I can see, they do not support ssl encryption. You should be aware, that any passive adversary inbetween you and the openweathermap server gets to know which locations weather you're interested in and can therefore probably conclude, where you live and where you're going to travel to in the next few days.

However, I already thought about splitting wego in backends and frontends. Each backend would then get the requested data from one specific API and convert it to a wego-specific format. Each frontend would take weather data in wego-specific format and reformat it for nice (current implementation) / parseable (just json?) / simple (a few lines of uncolored text?) / … output.

Patches are welcome, if you're interested, otherwise this backend/frontend separation will probably be done by myself sometime soon(tm).

@quite
Copy link
Author

quite commented Jan 27, 2015

All right. Yeah, I see now that only paid plans offer SSL. I'm personally
don't bother to force ssl on weather and similar programs, but I understand
those who do.

@schachmat schachmat changed the title Support for openweathermap.org Split we.go into backends and frontends May 14, 2015
@lacombar
Copy link

FWIW, this "open" weather map do not seem to be that "open".

@lacombar
Copy link

The wikipedia article about OWM talks about NOAA provided data. It might be interesting to check if NOAA provide SSL access to these data...

@lacombar
Copy link

Here is NOAA API informations: http://graphical.weather.gov/xml/ The site seems to answer on port 443, but the certificate domains doesn't match and the connection does not seem to make any progress.

@schachmat
Copy link
Owner

Some Ideas and plans:

  • Each backend/frontend lives in it's own file inside the backends or frontends folder.
  • Each backend/frontend registers itself against we.go within it's own init() function.
  • The WWO backend should use objx instead of constant structs.
  • The data structure interface should be roughly as the current structure but without structs. Use MSI with objx instead. Values should be supplied in metric format.
  • Each backend/frontend should get it's own sub node in the config file (to setup API keys, language support, unit system, etc.)

I recommend extrating the backend first.

@schachmat
Copy link
Owner

I finally managed to implement a satisfying solution for config+flag management and split the backend. You can have a peek at it on the issue1 branch @a9c2c6f. The frontend split should now be straight-forward and done within the week.

@schachmat
Copy link
Owner

Finally done and merged into master.

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

3 participants