8000 Adding a weather microservice by saijel · Pull Request #166 · claritylab/lucida · GitHub
[go: up one dir, main page]

Skip to content

Adding a weather microservice - #166

Closed
saijel wants to merge 3 commits into
claritylab:fixesfrom
saijel:fixes-weather-ms
Closed

saijel wants to merge 3 commits into
claritylab:fixesfrom
saijel:fixes-weather-ms

Conversation

@saijel
@saijel saijel commented Apr 14, 2017
Copy link
Copy Markdown
Contributor
  • created a weather microservice for port 8088
  • added classification data
  • created a testing thrift client
  • created Kubernetes .yaml scripts

@k0105
k0105 commented Apr 15, 2017 •
Copy link
Copy Markdown

So I can finally connect a face with the name. A pleasure to make your acquaintance. Will we be cooperating or is development going to stay an isolated thing?

Update:
Ah, so you were there, I only didn't associate any significance to the name before. Well, if either you or Johann want to cooperate - you know how to get in touch.

import urllib

port = 8088
owm_api_key = "362537b891e6df03a316e82565fe4df3"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ew Magic Numbers, can you move this to a config and put in the README that it needs to be set or something? Should be a "secret"


try:
# weather from Weather Underground
f = urllib2.urlopen('http://api.wunderground.com/api/%s/conditions/q/%s.json' % (wu_api_key, url_location) )
@jhauswald jhauswald Apr 15, 2017 •
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be a global

print "From Weather Underground: %s" % result
else:
# weather from Open Weather Map
f = urllib2.urlopen('http://api.openweathermap.org/data/2.5/weather?q=%s&appid=%s&units=imperial&type=like' % (url_location, owm_api_key))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global or some config

import json
import urllib

port = 8088
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really need to rethink how all the ports are set, it's super messy to have them nested deep into the code. then you need to worry about setting them correctly within the CMD center as well

@jhauswald
Copy link
Copy Markdown
Contributor

This generally looks good, I need to test it out but I like the content.

@jhauswald
Copy link
Copy Markdown
Contributor

We should probably merge #163 before this right? I'd want to be able to test this with your tmux script (since that makes it actually easier to test :P)

def create(self, LUCID, spec):
return

"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these docstrings should be inside the function header, check how we do it internally

@saijel
saijel commented Apr 17, 2017 via email
Copy link
Copy Markdown
Contributor Author

@k0105
k0105 commented Apr 18, 2017 •
Copy link
Copy Markdown

Why is this code mixing urllib2 and urllib? [There should be no reason to use urllib2 - all methods you call should be available in urllib.] And do you want me to keep commenting or shall I keep to myself?

@saijel saijel closed this Apr 28, 2017
@saijel
saijel deleted the fixes-weather-ms branch April 28, 2017 22:44
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

Successfully merging this pull request may close these issues.

3 participants

0