Comment on How To Parse JSON Data To A Human Readable Format
possiblylinux127@lemmy.zip 3 days ago
There are many different ways to do this
What is the usecase?
Comment on How To Parse JSON Data To A Human Readable Format
possiblylinux127@lemmy.zip 3 days ago
There are many different ways to do this
What is the usecase?
Use Case: I want to display a daily and extended forecast on a dashboard perhaps via an iframe or other means. I get tired of going to the weather channel and having them complain about my ad blocking techniques. LOL Also, I thought it would be a good learning exercise for me. I’m using n8n to pull the raw data from OpenWeather API. I can generate the JSON data fine (at least it was an accomplishment for me), it’s just getting that JSON data into a prettier format to display on a dashboard with maybe some pretty little weather icons later on when I get it down pat.
I mentioned Python because it seemed like a language I see others use for this sort of thing, but I am willing to explore other avenues. I am not very strong at coding. I can muck by, fiddling with this or that until I finally get something that works. Then I immediately commit that to my notes because my brain is shit at remembering things.
obdurant@lemmy.zip 3 days ago
I spent some time writing a script first in Python and then in ExcelScript at work to pull data from from OpenWeather API to compare ambient temperature and humidity to some of our indoor spaces. Both Python and JS (which ExcelScript is, basically) will make it very easy to pull the JSON from the API and pass whatever data you want down the line.
I don’t have any experience with dashboards or your setup in particular so I can’t give any good advice about how to go forward though. If you have a pre-existing dashboard, what makes it and what feeds it data? Is it a webpage or an app or such?
I am using the Homarr dashboard. It does have an iframe module that I think I could use once I pretty up the data.
obdurant@lemmy.zip 3 days ago
Okay, I see what you’re going for and from another comment that you want to avoid the built-in weather app that dashboard has. I agree that the iframe should work for what you want.
In this case I would make a webpage you can host locally, ignoring the dashboard aspect for a moment, and have it format the data how you want it to show up. If you want to use this as an excuse to tinker with Python and learn a new project I would probably follow the tutorial for Flask on setting up a simple webapp. I imagine by the end of it you could use the example project and tweak it somewhat painlessly to render what you want. Since you already have the ability to get the weather JSON you’ll just need to link the two up.
Anyway, once you have the page working properly you’ll have something to put in the iframe.
possiblylinux127@lemmy.zip 3 days ago
What dashboard are you using?
I’m using Homarr which has the capabilities of iframes.
Is this not JSON format?
Image
possiblylinux127@lemmy.zip 3 days ago
Is there are reason you can’t just use the Homar weather plugin?