这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Bnyro
Copy link
Member

@Bnyro Bnyro commented Apr 24, 2025

What does this PR do?

  • This PR adds result types and a template for weather engines

Why is this change important?

  • currently every engine hardcode its html

How to test this PR locally?

  • !om Berlin

Author's checklist

  • Duckduckgo Weather and Wttr.in are not migrated yet - they will be migrated as well after the answer type and template are finalized (if there any suggestions for improvements), I don't want to take the efforts to migrate and change them multiple times

Related issues

superseeds/closes #3256
related: #4542, #1800, #1352

2025-04-24T17:35:37,110507410+02:00
2025-04-24T17:35:45,160382185+02:00

@Bnyro Bnyro force-pushed the weather-template branch 2 times, most recently from 7b5879b to 94ac907 Compare April 24, 2025 15:51
@return42 return42 force-pushed the weather-template branch from 94ac907 to 2fec402 Compare May 2, 2025 14:49
@return42
Copy link
Member

return42 commented May 2, 2025

FYI: last force push was just a rebase on master branch.

@return42
Copy link
Member

return42 commented May 2, 2025

I pushed a WIP commit .. but I haven't yet finished my work .. I set this PR to DRAFT and will inform you, when I have finished my work .. he must have patience, the young jedi ;-)

@return42 return42 marked this pull request as draft May 2, 2025 17:19
@return42 return42 force-pushed the weather-template branch 2 times, most recently from 88ee545 to 7f08749 Compare May 6, 2025 16:36
@return42 return42 force-pushed the weather-template branch 2 times, most recently from c7c8bbf to 181166c Compare May 18, 2025 14:37
@return42
Copy link
Member

return42 commented May 18, 2025

Haven't yet finished my work, but if you want to have a look at current state .. I added types, i18n/l10n, symbols (icons) and unit conversions (based on what we had in the converter plugin) ..

image

and when selecting search language en-US temperature is converted into °F:

image

To see forecast, click on the table (or weather symbol) ..

image

@return42 return42 force-pushed the weather-template branch 2 times, most recently from 8fef6cd to c64636f Compare May 19, 2025 15:34
Copy link
Member Author

@Bnyro Bnyro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great already, thanks for your work!

I've left some comments / suggestions / questions.

@return42 return42 force-pushed the weather-template branch from c64636f to 91cbe67 Compare May 29, 2025 11:06
@return42 return42 force-pushed the weather-template branch from 91cbe67 to 32d136d Compare May 29, 2025 11:07
@return42 return42 marked this pull request as ready for review May 29, 2025 11:11
@return42
Copy link
Member

I've left some comments / suggestions / questions.

I have adopted some changes, see diff .. and I have left a comment with the others.

Switched PR from DRAFT to "ready for review" ..

margin: 0;
padding: 0.5rem 1rem;
background-color: var(--color-header-background);
.rounded-corners-tiny;
Copy link
Member Author

@Bnyro Bnyro May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the arrow to open the weather forecast is misaligned.

2025-05-31T19:13:52,585033174+02:00

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, we can fix it by replacing the <div class="summary"> with <span class="summary">, that's the simplest fix 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your first suggestion "list-style: none" works better .. for now .. the <summary> element is the simplest solution... it's a bit impractical because you can only expand/collapse it in the header. We should perhaps turn it into a horizontal (left/right) slider in a future PR.

@Bnyro
Copy link
Member Author

Bnyro commented May 31, 2025

Looks awesome to me after all, thanks for all the efforts you've put into this!
My initial work on this has been about 200 lines maybe, it's been improving a lot since then :)

I already thought about porting the other weather engines to using the new API but I think that would be better suited for a new PR, so we should merge this here first.

The types necessary for weather information such as GeoLocation, DateTime,
Temperature,Pressure, WindSpeed, RelativeHumidity, Compass (wind direction) and
symbols for the weather have been implemented.

There are unit conversions and translations for weather property labels.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
@return42 return42 force-pushed the weather-template branch from 32d136d to ffaf7ad Compare May 31, 2025 18:27
@return42 return42 merged commit 6e2d3e0 into searxng:master May 31, 2025
7 checks passed
@Bnyro Bnyro deleted the weather-template branch May 31, 2025 19:07
@Bnyro
Copy link
Member Author

Bnyro commented May 31, 2025

There it is, finally 🚀

Bnyro added a commit that referenced this pull request Jun 1, 2025
Author Notes
- wttr.in provides 8 hourly time forecasts per day, I assumed that they're always describing the weather for 3 hours each, starting at 1 o'clock in the morning

related:
- #4663
- #4885
Bnyro added a commit that referenced this pull request Jun 1, 2025
Author Notes
- wttr.in provides 8 hourly time forecasts per day, I assumed that they're always describing the weather for 3 hours each, starting at 1 o'clock in the morning

related:
- #4663
- #4885
Bnyro added a commit that referenced this pull request Jun 1, 2025
Author Notes
- wttr.in provides 8 hourly time forecasts per day, I assumed that they're always describing the weather for 3 hours each, starting at 1 o'clock in the morning

related:
- #4663
- #4885
return42 pushed a commit that referenced this pull request Jul 3, 2025
Author Notes
- wttr.in provides 8 hourly time forecasts per day, I assumed that they're always describing the weather for 3 hours each, starting at 1 o'clock in the morning

related:
- #4663
- #4885
return42 pushed a commit that referenced this pull request Jul 3, 2025
Author Notes
- wttr.in provides 8 hourly time forecasts per day, I assumed that they're always describing the weather for 3 hours each, starting at 1 o'clock in the morning

related:
- #4663
- #4885
return42 pushed a commit to return42/searxng that referenced this pull request Jul 3, 2025
Author Notes
- wttr.in provides 8 hourly time forecasts per day, I assumed that they're always describing the weather for 3 hours each, starting at 1 o'clock in the morning

related:
- searxng#4663
- searxng#4885
return42 pushed a commit that referenced this pull request Jul 3, 2025
Author Notes
- wttr.in provides 8 hourly time forecasts per day, I assumed that they're always describing the weather for 3 hours each, starting at 1 o'clock in the morning

related:
- #4663
- #4885
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants