Weather (wttr.in) Topic is solved

Suggestions for features and software you would like to see in DietPi, goes here.
Post Reply
Symorian
Posts: 4
Joined: Mon Jan 21, 2019 11:35 pm

Weather (wttr.in)

Post by Symorian »

Hello,

Weather (wttr.in) are very cool...but.... my home use EBOX internet provider and my ip address are in montreal, but i live in portneuf-sur-mer QC and when i connect into SSH i see weather of montreal... not portneuf-sur-mer...

Can you make change for we can change manualy weather to good weater ?

Sorry for my english, i speak french.

Best Regards
Ismael Cormier
User avatar
Phillski
Posts: 38
Joined: Fri Feb 02, 2018 10:52 am

Re: Weather (wttr.in)

Post by Phillski »

Hello Symorian
you can use the code from this post viewtopic.php?t=2778 to add a weather shortcut to your bash.
Then you can just type

Code: Select all

weather portneuf-sur-mer
to get the correct weather report.

To hardcode it to just that location then you can use the following code instead

Code: Select all

echo -e "\nfunction weather()\n{\nif [ \$COLUMNS -lt 125 ]\nthen\n  curl wttr.in/\portneuf-sur-mer?2n\nelse\n  curl wttr.in/\portneuf-sur-mer\nfi\n}" >> ~/.bashrc && source ~/.bashrc
User avatar
MichaIng
Site Admin
Posts: 3216
Joined: Sat Nov 18, 2017 6:21 pm

Re: Weather (wttr.in)

Post by MichaIng »

As a direct replacement, you could use a custom banner entry via dietpi-banner, using

Code: Select all

curl -sSfLm 3 https://wttr.in/portneuf-sur-mer?format=4
as command in the input box.
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: Weather (wttr.in)

Post by Joulinar »

at least if customer entry is not already used for other purposes ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 3216
Joined: Sat Nov 18, 2017 6:21 pm

Re: Weather (wttr.in)

Post by MichaIng »

True. Multiple custom entries would be nice :roll:.
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: Weather (wttr.in)

Post by Joulinar »

At least I use it to classify my system as Prod or Dev system as well as OS type ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
trendy
Posts: 360
Joined: Tue Feb 25, 2020 2:54 pm

Re: Weather (wttr.in)

Post by trendy »

You can have multiple custom entries:

Code: Select all

echo && echo "$(top -b -n 1 | head -n 3)" && free -h && echo && curl https://corona-stats.online/CZ && echo
User avatar
MichaIng
Site Admin
Posts: 3216
Joined: Sat Nov 18, 2017 6:21 pm

Re: Weather (wttr.in)

Post by MichaIng »

True, but it doesn't look as expected when not having the green dash in the front etc 8). But usable workaround until we have native multiple custom entries :).
Symorian
Posts: 4
Joined: Mon Jan 21, 2019 11:35 pm

Re: Weather (wttr.in)

Post by Symorian »

Thank you very much my friend !!! :)
Phillski wrote: Tue Jul 27, 2021 3:24 pm Hello Symorian
you can use the code from this post viewtopic.php?t=2778 to add a weather shortcut to your bash.
Then you can just type

Code: Select all

weather portneuf-sur-mer
to get the correct weather report.

To hardcode it to just that location then you can use the following code instead

Code: Select all

echo -e "\nfunction weather()\n{\nif [ \$COLUMNS -lt 125 ]\nthen\n  curl wttr.in/\portneuf-sur-mer?2n\nelse\n  curl wttr.in/\portneuf-sur-mer\nfi\n}" >> ~/.bashrc && source ~/.bashrc
Symorian
Posts: 4
Joined: Mon Jan 21, 2019 11:35 pm

Re: Weather (wttr.in)

Post by Symorian »

Wow thank you my friend. :)
MichaIng wrote: Wed Jul 28, 2021 1:52 pm As a direct replacement, you could use a custom banner entry via dietpi-banner, using

Code: Select all

curl -sSfLm 3 https://wttr.in/portneuf-sur-mer?format=4
as command in the input box.
Post Reply