feat: Basic CLI and OpenWeatherMap setup#4
Conversation
|
P. P. P. S. |
|
isnt os.getenv for getting an environment variable? do you expect all devs to get an api token? |
|
@im-coder-lg OpenWeatherMap's API is reallay liberal so I feel there is no reason not to keep a common key. You are allowed one request/second which is pretty good IMO for now |
|
I am SCARED of leaking that into open-source space right now. Plus, getting the API key for every individual is always easy, and also - we ought to look into it right now. I felt scared to death seeing the public key out there - right now, having |
sorta? Right now, I need to think carefully. 2000 calls ain't gonna work always, right? |
It's just a weather api, if its free no harm, right? |
|
Well, the API is for free use in this world, right? There is a possibility of someone finding this API key and using it for their own work. I can't end up finding my account just got billed, right? It could be just straight-up dangerous for me. Plus, we will have to help them get an API key for themselves, and perhaps fuel them to have ideas for this project/their own project. We can think of new ways for it later - right now, we don't want these hindrances. I'm just being paranoid, this is my "panic mode". # edit: signing off |
|
I've got an idea. We set up a server that has it's own api and gets a forecast for major cities so that the key never has to go public and the app just calls the server for some of the major cities that the user has added and the key never goes public (do less than 1,000 calls per day from the main server and the api is free too and now its just about setting up a free server (I'm supposed to get a raspberry pi sometime soon so maybe I could rig up my old one (raspberry pi 2B) to be the main server...) and then calling that server 😃 ) |
|
Who will have to pay for the domain tho... |
|
@im-coder-lg If you are scared about your account getting billed, we can use my API key. |
|
Huh. Well is there a way to keep it hidden from the users, just as a simple thing? |
|
A plan is formulating inside my brain, I bet it will be insanely cool. |
|
The reason I say no source folder is because I can set up the build action easier without one and I think it would be so cool to use this on my menubar |
|
Hmm @Moosems there IS one issue. The domain - how would we achieve that? Would DuckDNS work? |
I didn't get you here. What do you mean by a source folder? I thought we could use AppImages and Flatpaks... Right? |
|
I mean that in all other Futura projects there's a |
|
No, just put the |
A flask web app hosted on a raspberry pi doesn't require a domain |
|
I just have to ensure it NEVER turns off and has no important data on it (like location) |
|
No, a domain to access the server! |
|
-_- I know what you're saying, there's also free servers that provide a domain |
|
gottem guys |
|
And @im-coder-lg this is currently just prototype/POC code right? No production style quite yet |
|
Guys, this is ready for merge. Screenshot of how I wanted it to work: To-do list(I'll make it official):
Does this look good? Anything I have to remove/change? I need to know, gotta plan availability. |
|
Never works when I type in the city :\ |
|
Huh. Can you send a screenshot? |
|
Maybe you didn't enter the city name properly? It happened when I tried searching for NYC once, y'know. The second try worked though. |
|
It's the TOKEN as an env variable, mac likes to be picky |
|
Wait, hold on. I put the TOKEN variable as a globally-declared string! Screenshots, please! I gotta know what went wrong. |
|
Because you put the TOKEN = os.getenv("TOKEN") after it turns into the env var and I can't set it for some reason on my mac |
|
can't set the env var* |
|
Oh, now I see what you did there. And yeah, even I see it now. Odd. Very odd. |
|
Lemme debug this and see. |
|
@Moosems fixed 👍 I think I accidentally added the .env part, which is damn odd... |
2023-01-31.20-46-44.mp4Fix proved here ⬆️ |
|
As you can see, restarting leads to errors. I think I know a fix though. Edit: fix fail :( |
|
@sumeshir26 I need help in clearing the CITY variable on every restart. Can you help? |
Sure |
Moosems
left a comment
There was a problem hiding this comment.
Good first draft. Lets set some clear cut goals now and go from there :)


Our first order of business, fellas!
P.S. to test, use VS Code.
P. P. S. now we can test the API to make sure our request always works.