weather-fetcher
weather-fetcher copied to clipboard
Request: Choose the location ?
Thank you for this plugin 🙌 !
Similarly to the different formats request in #1, would it be possible to add the ability to define a default location in the settings ? I'm asking because I use a VPN which is not always set to my actual location in my country, so the weather I get is not the right one when my VPN is enabled 😇. It works perfectly if I just disable my VPN though 🙌 ... but I just think it would be easier to set up a default location in the settings of the plugin and forget about it than the other way around 😊 ...
It’s indeed possible. But here comes a problem: the plugin how to decide to use the default location or the real time location? I haven’t figured it out yet, and any suggestions are welcome!
I have the same problem - my location is set incorrectly, though I am not using a VPN. (Trying from a mobile device, so perhaps cellular is causing an issue?)
Perhaps if the plugin had two commands - one to automatically choose the location, and another to use the preset location?
Or, perhaps the plugin could prompt the user whether they wanted to choose a preset location or let the plugin figure it out?
I have the same problem - my location is set incorrectly, though I am not using a VPN. (Trying from a mobile device, so perhaps cellular is causing an issue?)
I'm not sure it could be a desktop vs. mobile issue 🤔 ... I used it yesterday on desktop (without VPN) and for some reason, the plugin located me roughly 90km from where I actually stand 😅 ...
Perhaps if the plugin had two commands - one to automatically choose the location, and another to use the preset location?
Or, perhaps the plugin could prompt the user whether they wanted to choose a preset location or let the plugin figure it out?
I like those ideas 💡 😁 ! The 1st one could simply be added to the command palette 😊 (e.g.: Add current weather for location X)
我使用PC,但是一直提取到的都是"not found"。
我没有移动需求,所以我自己更正了下插件的代码
plugins/weather-fetcher/main.js
文件
第1619行:
if (source === "wttr") {
const res1 = yield fetch("https://wttr.in/{location}?format=4");
const res2 = yield res1.text();
我直接把城市名字写在了{location}的位置上 , 重启obsidian后工作良好.
The location being used looks like is the ISP L3 gateway, so in my case terminates 200Km from my real location, so maybe the weather could be used in conjunction with map plugin where you can insert a location and weather can look at this and get weather information?
我使用PC,但是一直提取到的都是"not found"。 我没有移动需求,所以我自己更正了下插件的代码
plugins/weather-fetcher/main.js
文件 第1619行:if (source === "wttr") { const res1 = yield fetch("https://wttr.in/{location}?format=4"); const res2 = yield res1.text();
我直接把城市名字写在了{location}的位置上 , 重启obsidian后工作良好.
谢谢,这个办法直接,我也改过来了。真的没想到在这里找到了解决办法
Great idea for a plugin!
I'm not sure how the location is parsed, but I'm getting:
not found: ☀️ 🌡️+12°C 🌬️↙4km/h
Is there a way to adjust that?
step1:you could just navigate to this file: your ob vault.obsidian\plugins\weather-fetcher\main.js
step2:locate to line 1619 and using next codes to replace
if (source === "wttr") { const res1 = yield fetch("https://wttr.in/{location}?format=4"); const res2 = yield res1.text();
step3:replace the text in {location} with your city name, for example, asking for London weather
const res1 = yield fetch("https://wttr.in/{London}?format=4");
step4: save the main.js file and restart ob
Done and enjoy it.
Outstanding, thanks for the simple solution. One last question: is there a way for Yanks to display Fahrenheit?
Outstanding, thanks for the simple solution. One last question: is there a way for Yanks to display Fahrenheit?
this easy, just change to this in step3
const res1 = yield fetch("https://wttr.in/{London}?format=4&u");
then,you'll get this Fahrenheit unit:
{London}: 🌧 🌡️+54°F 🌬️→19mph
by the way, access to authors's site for more customization
https://github.com/chubin/wttr.in