Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Dynamically Change URL in Weather Module Based on User's Preferred Language #320

Open
zfyzmh opened this issue Mar 6, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@zfyzmh
Copy link

zfyzmh commented Mar 6, 2024

The click-through on the weather module should switch the URL link based on the preferred language instead of always being 'en-us' 'https://www.msn.com/en-us/weather/forecast/'.

天气模块的点击跳转根据首选语言来进行切换url链接而不是永远的 en-us 'https://www.msn.com/en-us/weather/forecast/'

@victrme victrme added the enhancement New feature or request label Mar 6, 2024
@victrme
Copy link
Owner

victrme commented Mar 6, 2024

Hello @zfyzmh !

This was originally planned, but because their URLs path names are translated, this has to be done manually for every language:

This is annoying but doable. I don't know when this will be added though !

@GhostScript0r
Copy link

GhostScript0r commented May 28, 2024

Hello @zfyzmh !

This was originally planned, but because their URLs path names are translated, this has to be done manually for every language:

This is annoying but doable. I don't know when this will be added though !

One possible way to do it is using a web search engine (like DuckDuckGo) to search for the URLs in for each language.

Searching for "MSN Weather site:msn.com/fr-fr" in DuckDuckGo and the the first result will be MSN weather in French language. Grab its URL and trim the URL after the 4th level (after the word "forecast").

With a list of all MSN locales, it's possible to create a JSON dictionary connecting locales and URLs with duckduckgo_search module in Python. We don't need to search for all languages, since only languages in Latin script get their URL path name translated.

@victrme
Copy link
Owner

victrme commented May 28, 2024

I agree @GhostScript0r, that would work. It might be faster to do it manually however 😅

If you want to do that script and post your result here, that would be super helpful !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants