Plugin to pull current weather from OpenWeather API

Wanted a quick way to reference current weather in morning/evening notes. Was curious about Logseq’s plugin API, so tried my hand at writing a plugin. Even though I’m new to Logseq and TypeScript it was not too difficult to find my way around. Thank you to everyone involved in making Logseq awesome :slight_smile:

Here’s what I wrote so far, would love feedback on how I could write more pragmatic code for the plugin:

This is great and yet another reason I will be migrating from Obsidian to Logseq in the weeks/months to come.

I especially love how easy it looks to be to get all the data as properties - that’s really key to me since I want to be able to analyze the data over the year.

My request, however, would be to be able to pull the day’s forecast data rather than the current data. Ideally I want to figure out how to have the daily log created automatically and for it to pull the day’s weather forecast info. If the file is created automatically at 3am, the current weather isn’t really all that helpful! If it can show it pretty like this as well as have the data as properties that would be a bonus!

Properties are most important - high, low temps, wind speed and direction, humidity, pressure, uv index, rain chance

Anyway - excellent work on this!

image

1 Like