You are not logged in.

#181 2025-12-11 13:40:02

loutch
Member
Registered: 2015-12-12
Posts: 967

Re: Conky Weather TAD script

Re

@ marens

same as website but now have this now file

Température: Température: 10 °C °C
Ressentie: 9 °C °C
Maxi et mini: 10 / 6 °C
Overcast.
Visibilité: N/A km
Pression: 1024 mbarmbar
Humidité: 88%%
Point de rosée: 8 °C °C
Vent: 7 km/h 
from East
Mise @ jour 11 déc 2025, 14 h 00

@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#182 2025-12-11 13:49:06

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

^ This line is no longer needed:

sed -i -e '1s/$/ °C/' -e '1s/^/Temperature: /' -e '2s/$/ °C/' -e '3s/$/ °C/' -e '5s/$/ km/' -e '6s/$/mbar/' -e '7s/$/%/' -e '8s/$/ °C/' $HOME/time_and_date_conky_script/now

Sorry, I forgot to tell you.  smile

EDIT
If you want, you can keep only:

sed -i -e '3s/$/ °C/' $HOME/time_and_date_conky_script/now

Last edited by marens (2025-12-11 14:01:18)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#183 2025-12-11 13:57:43

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,740

Re: Conky Weather TAD script

Moderator edit -
Added "Weather" to title so new members know what the script does, and it will (should) show up in a search.

Checked "Stick Topic"


You must unlearn what you have learned.
    -- yoda

Offline

#184 2025-12-11 14:07:29

loutch
Member
Registered: 2015-12-12
Posts: 967

Re: Conky Weather TAD script

Re

@ marens

Oki-d0ki

You are completely forgiven, forgetting things happens everything is fine.

@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#185 2025-12-11 14:07:52

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

@PackRat

Thanks, but I think we should wait.
I don't have the final version of the script for all locations yet.

Can you find your location and test in the same way as described here:
https://forums.bunsenlabs.org/viewtopic … 94#p147694

Last edited by marens (2025-12-11 14:11:20)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#186 2025-12-12 05:12:36

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,926
Website

Re: Conky Weather TAD script

marens wrote:

...try this to see if it works for your location:
Open:
https://www.timeanddate.com/weather/japan/nagoya
Download weather_raw data:

curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -s "https://www.timeanddate.com/weather/japan/nagoya" > weather_raw

Then try to extract the data into the "now" file:

cat weather_raw | grep -o '[ ^]class=h2>[^<]*' | sed 's/^/Temperature:/' | sed 's/class=h2>//' | sed 's/&nbsp;/ /' > now

cat weather_raw | grep -o '[F^]eels Like:[^<]*' | sed 's/&nbsp;/ /' >> now

cat weather_raw | grep -o '[ ^]title="High and low forecasted temperature today">Forecast: [^&nbsp;]*' | awk -F'>' '{print $2}' >> now

cat weather_raw | grep -o '[ ^]id=cur-weather class=mtt title="[^"]*' | sed 's/><img id=cur-weather class=mtt title="//' | sed 's/ id=cur-weather class=mtt title="//' >> now

cat weather_raw | grep -o '[V^]isibility: [^P]*' | sed 's/<\/th><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><tr><th>//' >> now

cat weather_raw | grep -o '[P^]ressure: [^H]*' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> now

cat weather_raw | grep -o '[H^]umidity:[^D]*' | sed '$d' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> now

cat weather_raw | grep -o '[D^]ew Point: [^ ]*' | sed 's/<\/th><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><\/tbody><\/table><\/div><div//' >> now

cat weather_raw | grep -o '[W^]ind: [^<]*' | sed '$d' >> now

cat weather_raw | grep -o '[>^] from[^<]*' | sed '$d' | sed 's/> //' >> now

cat weather_raw | grep -o '[L^]atest Report: [^V]*' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> now

Open the "now" file and compare the data with what the browser displays.
Is everything the same?

It's almost the same, except for the final "Latest Report" date/time which is rendered  in Japanese in "now" but in English on the web page.

If you'd like to check, here's "now":

Temperature: 8 °C
Feels Like: 3 °C
Forecast: 11 / 0
Passing clouds.
Visibility: N/A
Pressure: 1024 mbar
Humidity: 53%
Dew Point: -1 °C
Wind: 46 km/h 
from North
Latest Report: 2025年12月12日 (金)13時30分

And here's a screenshot:
imgbb-2025-12-12-14-10-11.png
Imgbb crops the thumbnail so you'll have to click through to the fullsized image to see it.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#187 2025-12-12 13:00:20

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

^ Thanks for testing.

That's nothing new to me.
Although I don't know what those Japanese symbols (letters) mean, it's pretty easy to solve:

echo 'Latest Report: 2025年12月12日 (金)13時30分' | sed 's/年/\//' | sed 's/月/\//' | sed 's/日 (金)/ /' | sed 's/時/:/' | sed 's/分//'
Latest Report: 2025/12/12 13:30

I will add that part to the final version of the TAD script.

---

So far, I can say that the results seem encouraging:

1) I didn't have a large sample to test, but I remembered that @sleekmason (US) sent me his weather_raw file:
https://forums.bunsenlabs.org/viewtopic … 56#p146356

2) @loutch and I are from Europe but the website shows different content and units in our countries.

3) I don't know what region @asqwerth is in, but thanks to the time zone I know it's far from Europe.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#188 2025-12-12 13:07:41

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,091

Re: Conky Weather TAD script

Mine:

https://www.timeanddate.com/weather/argentina/buenos-aires

Download weather_raw data:

curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -s "https://www.timeanddate.com/weather/argentina/buenos-aires" > weather_raw

Then extracted the data to the "now" file.

Same as John's, all data is the same except the last line:
Spanish here:
Latest Report: 12 de dic de 2025, 9:00
Webpage:
Latest Report:     12 Dec 2025, 09:00

However when reading the "now" file one just needs the time really:
OR if your system handles the language in the text file, now, use it.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#189 2025-12-12 13:48:20

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,740

Re: Conky Weather TAD script

Working

Temperature: 35 °F
Feels Like: 35 °F
Forecast: 61 / 29
Sunny.
Visibility: 10 mi
Pressure: 30.11 "
Humidity: 82%
Dew Point: 30 °F
Wind: No wind
Latest Report: Dec 12, 2025 at 7:53 am

You must unlearn what you have learned.
    -- yoda

Offline

#190 2025-12-12 13:53:23

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

@Sector11

Thanks for testing.
This can be solved by adding a long sed command that will convert the Spanish month names to English.

sed -i -e 's/xxx/Jan/' -e 's/xxx/Feb/' -e 's/xxx/Mar/' -e 's/xxx/Apr/' -e 's/xxx/May/' -e 's/xxx/Jun/' -e 's/xxx/Jul/' -e 's/xxx/Aug/' -e 's/xxx/Sep/' -e 's/xxx/Oct/' -e 's/xxx/Nov/' -e 's/xxx/Dec/' $HOME/now

* xxx are the names of the months in Spanish.

EDIT

$ echo 'Latest Report: 12 de dic de 2025, 9:00' | sed 's/de dic de/Dec/'
Latest Report: 12 Dec 2025, 9:00

$ echo 'Latest Report: 12 de dic de 2025, 9:00' | sed 's/de dic de/December/'
Latest Report: 12 December 2025, 9:00

Last edited by marens (2025-12-12 14:40:20)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#191 2025-12-12 13:57:31

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

@PackRat

Thanks for confirming.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#192 2025-12-12 14:04:40

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

@asqwerth
@loutch

I'm testing the final version of the TAD script.
Everything here works as it should, but I need feedback.

#!/bin/bash

## Time and Date is the world's leading time and time zone website.

## Be sure to visit it because it has very useful things for each location and all the data is displayed in real time
## Weather forecast is just a small part of what this great website offers.


# Go to https://www.timeanddate.com/weather
# Find your address in the search field.

#Copy the address from the Firefox URL bar and paste it in the same form here instead of Paris, France.

address="https://www.timeanddate.com/weather/france/paris"

curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -s "$address" > $HOME/time_and_date_conky_script/weather_raw


#### NOW FORECAST

## Temperature
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2>[^<]*' | sed 's/^/Temperature:/' | sed 's/class=h2>//' | sed 's/&nbsp;/ /' > $HOME/time_and_date_conky_script/now

## Feels Like
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[F^]eels Like:[^<]*' | sed 's/&nbsp;/ /' >> $HOME/time_and_date_conky_script/now

## Forecast
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]title="High and low forecasted temperature today">Forecast: [^&nbsp;]*' | awk -F'>' '{print $2}' >> $HOME/time_and_date_conky_script/now

## Text Now
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]id=cur-weather class=mtt title="[^"]*' | sed 's/ id=cur-weather class=mtt title="//' >> $HOME/time_and_date_conky_script/now

## Visibility
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[V^]isibility: [^P]*' | sed 's/<\/th><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/time_and_date_conky_script/now

## Pressure
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[P^]ressure: [^H]*' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/time_and_date_conky_script/now

## Humidity
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[H^]umidity:[^D]*' | sed '$d' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/time_and_date_conky_script/now

## Dew Point
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[D^]ew Point: [^ ]*' | sed 's/<\/th><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><\/tbody><\/table><\/div><div//' >> $HOME/time_and_date_conky_script/now

## Wind
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[W^]ind: [^<]*' | sed '$d' >> $HOME/time_and_date_conky_script/now

## Wind Direction
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[>^] from[^<]*' | sed '$d' | sed 's/> //' >> $HOME/time_and_date_conky_script/now

## Latest Report
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[L^]atest Report: [^V]*' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' | sed 's/年/\//' | sed 's/月/\//' | sed 's/日 (金)/ /' | sed 's/時/:/' | sed 's/分//' >> $HOME/time_and_date_conky_script/now


## Now Image
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '1q;d' | sed 's/ src="/https:/' | sed 's/.$//' > $HOME/time_and_date_conky_script/images

day_0=$(sed -n '1p' $HOME/time_and_date_conky_script/images | awk -F'svg/' '{print $2}' | sed 's/svg/png/')

cp $HOME/time_and_date_conky_script/tad-icons/$day_0 $HOME/time_and_date_conky_script/0.png

> $HOME/time_and_date_conky_script/images

## Wind Direction Image
wd=$(sed -n '10p' $HOME/time_and_date_conky_script/now | sed 's/from //' | sed 's/North/N/g' | sed 's/north/N/g' |  sed 's/South/S/g' | sed 's/south/S/g' |  sed 's/East/E/g' | sed 's/east/E/g' | sed 's/West/W/g' | sed 's/west/W/g' | sed 's/-//' | sed 's/$/.png/')

## Wind Rose
                       ## 04/12/25                         
  if [[ "$wd" == ".png" ]] || [[ "$wd" == "Wind: N/A .png" ]]; then
  
      cp $HOME/time_and_date_conky_script/wind/CLM.png $HOME/time_and_date_conky_script/wind_0.png

        else
    
           cp $HOME/time_and_date_conky_script/wind/$wd $HOME/time_and_date_conky_script/wind_0.png
      
  fi


#### DAILY FORECAST

## Temperatures (Next 7 days) 
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[^ ]*width=60 height=60><p>[^&nbsp;]*' | sed 's/width=60 height=60><p>//' | sed 7q > $HOME/time_and_date_conky_script/temperatures

## Images (Next 7 Days)
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed -n '19,25p' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' > $HOME/time_and_date_conky_script/images

## Icons (Next 7 Days)
  j=1
                       
    for (( i=1; i<=7; i+=1 ))
			
      do
		    	
        cp $HOME/time_and_date_conky_script/tad-icons/$(sed -n ${i}p $HOME/time_and_date_conky_script/images) $HOME/time_and_date_conky_script/day_$j.png
    
  ((j++))
  
  done
  
## Phrase (Next 7 Days)
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=mtt title="[^"]*' | sed -n '18,24p' | sed 's/ class=mtt title="//' > $HOME/time_and_date_conky_script/phrase   
  

#### HOURLY FORECAST

## Temperature
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class="h2 soft" [^ ]*' | sed -e 's/<\/td><td>/\n/g' | sed '1,1d' | sed 's/ class="h2 soft" ><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><\/tbody><\/table><\/div><p//' > $HOME/time_and_date_conky_script/hourly/temperature

## Time
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^r]*' | sed -e 's/<\/td><td>/\n/g' | sed '1,1d' | sed 's/<\/td><\/t//' > $HOME/time_and_date_conky_script/hourly/time


## Images
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | awk -F'svg/' '{print $2}' | sed -n '3,7p' | sed 's/.$//' | sed 's/svg/png/' > $HOME/time_and_date_conky_script/hourly/images

## Icons
  j=1
                       
    for (( i=1; i<=5; i+=1 ))
			
      do
		    	
        cp $HOME/time_and_date_conky_script/tad-icons/$(sed -n ${i}p $HOME/time_and_date_conky_script/hourly/images) $HOME/time_and_date_conky_script/hourly/hourly_$j.png
    
  ((j++))
  
  done
  

#### DAY + DATE (Next 7 Days) 
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -s "$address/ext" > $HOME/time_and_date_conky_script/date-raw

cat $HOME/time_and_date_conky_script/date-raw | grep -o '[,^]"ds":"[^"]*' | sed 's/,"ds":"//g' | sed 's/\.//g' | sed -n '1,7p' > $HOME/time_and_date_conky_script/date

Note *
Don't forget to change the location (instead of Paris, France)

@asqwerth

The script you are using is very similar to the final version with a few minor changes.
These are mostly things we tested together.
The layout has also been slightly modified to make the script more understandable.

@loutch

You haven't followed the previous updates and you need to know a few new things:

1) @askwerth discovered the 'MONDAY' bug which was fixed by deleting the "date_and_phrase" file and adding separate "date" and "phrase" files
2) I think you will get the data in the "date" file in French
3) You will easily translate the "phrase" file into French because you have already done it

If you both confirm that everything is fine, I will probably publish the final version with the necessary instructions for beginners by the end of the week.

P.S.
The final version of the TAD script will use the original icons by default.
@asqwerth, can I rename your icons to tad-icons-WU?

Last edited by marens (2025-12-12 21:00:40)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#193 2025-12-12 15:41:54

loutch
Member
Registered: 2015-12-12
Posts: 967

Re: Conky Weather TAD script

Hello conky friend

All work great with the new script, now file & website are the same .

great job  .

Température: 8 °C
Ressentie: 7 °C
Maxi et mini: 8 / 4
Fog.
Visibilité: 4 km
Pression: 1022 mbar
Humidité: 93%
Point de rosée: 7 °C
Vent: 6 km/h 
du nord
Mise @ jour 12 déc 2025, 16 h 00
Brouillard.

@+

Last edited by loutch (2025-12-12 15:43:02)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#194 2025-12-12 15:56:21

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

^ Thanks.

If you look at the "Forecast for the next 2 weeks" table on the website, you'll see that this is the forecast line for tomorrow:

Maxi et mini: 8 / 4

If you want to add  " °C "  at the end, look here (EDIT):
https://forums.bunsenlabs.org/viewtopic … 08#p147708


If people would know how little brain is ruling the world, they would die of fear.

Offline

#195 2025-12-12 16:18:20

loutch
Member
Registered: 2015-12-12
Posts: 967

Re: Conky Weather TAD script

Re

Are you sure , here website

B42ay1ah_t.png


edit:

I have a question about icons. I would like to use vcloud icons, but I cannot find a list of them on the website.

tanks.


@+

Last edited by loutch (2025-12-12 16:47:14)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#196 2025-12-12 18:36:51

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

^ Yes, I'm sure.

Today is Friday.
The "Forecast for the next 2 weeks" table shows the forecast for tomorrow 9 / 2 °C just like in the first screenshot.

now.png  daily.png

If you want VClouds icons you will have to do the same as @asqwerth.
Create a new folder tad-icons-vclouds.

These new icons must have the same names as the original wt-XX.png.

tad-icons.png  tad-icons-WU.png


If people would know how little brain is ruling the world, they would die of fear.

Offline

#197 2025-12-12 21:02:30

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

@loutch

Did you notice an error in the terminal?
I don't know how, but there are two  cat  commands at the beginning of this line:

Replace:

## Time
cat cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^r]*' | sed -e 's/<\/td><td>/\n/g' | sed '1,1d' | sed 's/<\/td><\/t//' > $HOME/time_and_date_conky_script/hourly/time

With:

## Time
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^r]*' | sed -e 's/<\/td><td>/\n/g' | sed '1,1d' | sed 's/<\/td><\/t//' > $HOME/time_and_date_conky_script/hourly/time

No more errors in the terminal.

The script in the post above has been edited:
https://forums.bunsenlabs.org/viewtopic … 41#p147741

Looks like we're getting old, my 'conky friend'.  smile

Last edited by marens (2025-12-13 00:45:30)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#198 2025-12-13 10:45:27

loutch
Member
Registered: 2015-12-12
Posts: 967

Re: Conky Weather TAD script

Hello

No errors in terminal , script work great & in french .

my script

#!/bin/bash

### create by marens from bunsenlabs forum & modifié par moi pour le français
# Go to https://www.timeanddate.com/weather
# Find your address in the search field.

# Copy the address from the Firefox URL bar and paste it in the same form here instead of Paris, France.

address="https://www.timeanddate.com/weather/@6454374"

curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -s "$address" > $HOME/accuweather_marens_rss/weather_raw

#### NOW
## Temperature
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]class=h2>[^<]*' | sed 's/^/Temperature:/' | sed 's/class=h2>//' | sed 's/&nbsp;/ /' > $HOME/accuweather_marens_rss/now

## Feels Like
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[F^]eels Like:[^<]*' | sed 's/&nbsp;/ /' >> $HOME/accuweather_marens_rss/now
sed -i -e '3s/$/ °C/' $HOME/accuweather_marens_rss/now
## Forecast
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]title="High and low forecasted temperature today">Forecast: [^&nbsp;]*' | awk -F'>' '{print $2}' >> $HOME/accuweather_marens_rss/now
sed -i -e '3s/$/°C/' $HOME/accuweather_marens_rss/now
## Text Now
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]id=cur-weather class=mtt title="[^"]*' | sed 's/ id=cur-weather class=mtt title="//' >> $HOME/accuweather_marens_rss/now

## Visibility
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[V^]isibility: [^P]*' | sed 's/<\/th><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/accuweather_marens_rss/now

## Pressure
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[P^]ressure: [^H]*' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/accuweather_marens_rss/now

## Humidity
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[H^]umidity:[^D]*' | sed '$d' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/accuweather_marens_rss/now

## Dew Point
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[D^]ew Point: [^ ]*' | sed 's/<\/th><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><\/tbody><\/table><\/div><div//' >> $HOME/accuweather_marens_rss/now

## Wind
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[W^]ind: [^<]*' | sed '$d' >> $HOME/accuweather_marens_rss/now

## Wind Direction
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[>^] from[^<]*' | sed '$d' | sed 's/> //' >> $HOME/accuweather_marens_rss/now

## Latest Report
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[L^]atest Report: [^V]*' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/accuweather_marens_rss/now

### Traduction ####
sed -i -e 's/Temperature/Température/g' $HOME/accuweather_marens_rss/now
sed -i -e 's/Feels Like/Ressentie/g' $HOME/accuweather_marens_rss/now
sed -i -e 's/Forecast/Maxi et mini/g' $HOME/accuweather_marens_rss/now
sed -i -e 's/Visibility/Visibilité/g' $HOME/accuweather_marens_rss/now
sed -i -e 's/Pressure/Pression/g' $HOME/accuweather_marens_rss/now
sed -i -e 's/Humidity/Humidité/g' $HOME/accuweather_marens_rss/now
sed -i -e 's/Dew Point/Point de rosée/g' $HOME/accuweather_marens_rss/now
sed -i -e 's/Wind/Vent/g' $HOME/accuweather_marens_rss/now
sed -i -e 's/Latest Report:/Mise @ jour/g' $HOME/accuweather_marens_rss/now
sed -n  '4p' $HOME/accuweather_marens_rss/now | trans -brief :fr  >> $HOME/accuweather_marens_rss/now
#### direction du vent #####
sed -n  '10p' $HOME/accuweather_marens_rss/now | trans -brief :fr  >> $HOME/accuweather_marens_rss/now

#### Images

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '1q;d' | sed 's/ src="/https:/' | sed 's/.$//' > $HOME/accuweather_marens_rss/images

day_0=$(sed -n '1p' $HOME/accuweather_marens_rss/images | awk -F'svg/' '{print $2}' | sed 's/svg/png/')

cp $HOME/accuweather_marens_rss/tad-icons/$day_0 $HOME/accuweather_marens_rss/0.png


> $HOME/accuweather_marens_rss/images

## Wind Direction
wd=$(sed -n '10p' $HOME/accuweather_marens_rss/now | sed 's/from //' | sed 's/North/N/g' | sed 's/north/N/g' |  sed 's/South/S/g' | sed 's/south/S/g' |  sed 's/East/E/g' | sed 's/east/E/g' | sed 's/West/W/g' | sed 's/west/W/g' | sed 's/-//' | sed 's/$/.png/')

  if [[ "$wd" == ".png" ]]; then
  
      cp $HOME/accuweather_marens_rss/wind/CLM.png $HOME/accuweather_marens_rss/wind_0.png

        else
    
           cp $HOME/accuweather_marens_rss/wind/$wd $HOME/accuweather_marens_rss/wind_0.png
      
  fi


############

## Daily Date + Phrase - Next 7 Days

cat $HOME/accuweather_marens_rss/weather_raw | grep 'View historic weather' | awk -F'ext&#39;)"><div class=wt-dn>' '{print $2}' | awk -F'"' '{print $1, $2}' | sed 's/<\/div><img class=mtt title=/ /' > $HOME/accuweather_marens_rss/date_and_phrase

cat $HOME/accuweather_marens_rss/weather_raw | grep 'View historic weather' | awk -F'ext&#39;)"><div class=wt-dn>' '{print $3}' | awk -F'"' '{print $1, $2}' | sed 's/<\/div><img class=mtt title=/ /' >> $HOME/accuweather_marens_rss/date_and_phrase

cat $HOME/accuweather_marens_rss/weather_raw | grep 'View historic weather' | awk -F'ext&#39;)"><div class=wt-dn>' '{print $4}' | awk -F'"' '{print $1, $2}' | sed 's/<\/div><img class=mtt title=/ /' >> $HOME/accuweather_marens_rss/date_and_phrase

cat $HOME/accuweather_marens_rss/weather_raw | grep 'View historic weather' | awk -F'ext&#39;)"><div class=wt-dn>' '{print $5}' | awk -F'"' '{print $1, $2}' | sed 's/<\/div><img class=mtt title=/ /' >> $HOME/accuweather_marens_rss/date_and_phrase

cat $HOME/accuweather_marens_rss/weather_raw | grep 'View historic weather' | awk -F'ext&#39;)"><div class=wt-dn>' '{print $6}' | awk -F'"' '{print $1, $2}' | sed 's/<\/div><img class=mtt title=/ /' >> $HOME/accuweather_marens_rss/date_and_phrase

cat $HOME/accuweather_marens_rss/weather_raw | grep 'View historic weather' | awk -F'ext&#39;)"><div class=wt-dn>' '{print $7}' | awk -F'"' '{print $1, $2}' | sed 's/<\/div><img class=mtt title=/ /' >> $HOME/accuweather_marens_rss/date_and_phrase

cat $HOME/accuweather_marens_rss/weather_raw | grep 'View historic weather' | awk -F'ext&#39;)"><div class=wt-dn>' '{print $8}' | awk -F'"' '{print $1, $2}' | sed 's/<\/div><img class=mtt title=/ /' >> $HOME/accuweather_marens_rss/date_and_phrase

### Traduction ####
sed -n  'p' $HOME/accuweather_marens_rss/date_and_phrase | trans -brief :fr  >> $HOME/accuweather_marens_rss/date_and_phrase
## Daily Forecast Images - Next 7 Days

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '19q;d' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' > $HOME/accuweather_marens_rss/images

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '20q;d' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' >> $HOME/accuweather_marens_rss/images

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '21q;d' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' >> $HOME/accuweather_marens_rss/images

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '22q;d' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' >> $HOME/accuweather_marens_rss/images

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '23q;d' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' >> $HOME/accuweather_marens_rss/images

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '24q;d' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' >> $HOME/accuweather_marens_rss/images

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '25q;d' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' >> $HOME/accuweather_marens_rss/images

  j=1
                       
    for (( i=1; i<=7; i+=1 ))
			
      do
		    	
        cp $HOME/accuweather_marens_rss/tad-icons/$(sed -n ${i}p $HOME/accuweather_marens_rss/images) $HOME/accuweather_marens_rss/day_$j.png
    
  ((j++))
  
  done
    
## Temperatures - Next 7 days 

cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[^ ]*width=60 height=60><p>[^&nbsp;]*' | sed 's/width=60 height=60><p>//' | sed 7q > $HOME/accuweather_marens_rss/temperatures

#### HOURLY

## Images
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | awk -F'svg/' '{print $2}' | sed -n '3,7p' | sed 's/.$//' | sed 's/svg/png/' > $HOME/accuweather_marens_rss/hourly/images

## Temperature
cat $HOME/accuweather_marens_rss/weather_raw | grep 'tr class="h2 soft"' | awk -F'height=80></td></tr><tr class="h2 soft" ><td>' '{print $2}' | awk -F'</td><td>' '{print $2}' | sed 's/&nbsp;/ /' > $HOME/accuweather_marens_rss/hourly/temperature

cat $HOME/accuweather_marens_rss/weather_raw | grep 'tr class="h2 soft"' | awk -F'height=80></td></tr><tr class="h2 soft" ><td>' '{print $2}' | awk -F'</td><td>' '{print $3}' | sed 's/&nbsp;/ /' >> $HOME/accuweather_marens_rss/hourly/temperature

cat $HOME/accuweather_marens_rss/weather_raw | grep 'tr class="h2 soft"' | awk -F'height=80></td></tr><tr class="h2 soft" ><td>' '{print $2}' | awk -F'</td><td>' '{print $4}' | sed 's/&nbsp;/ /' >> $HOME/accuweather_marens_rss/hourly/temperature

cat $HOME/accuweather_marens_rss/weather_raw | grep 'tr class="h2 soft"' | awk -F'height=80></td></tr><tr class="h2 soft" ><td>' '{print $2}' | awk -F'</td><td>' '{print $5}' | sed 's/&nbsp;/ /' >> $HOME/accuweather_marens_rss/hourly/temperature

cat $HOME/accuweather_marens_rss/weather_raw | grep 'tr class="h2 soft"' | awk -F'height=80></td></tr><tr class="h2 soft" ><td>' '{print $2}' | awk -F'</td><td>' '{print $6}' | sed 's/&nbsp;/ /' | awk -F'</td></tr>' '{print $1}' >> $HOME/accuweather_marens_rss/hourly/temperature

## Hourly Time
cat $HOME/accuweather_marens_rss/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^r]*' | sed -e 's/<\/td><td>/\n/g' | sed '1,1d' | sed 's/<\/td><\/t//' > $HOME/accuweather_marens_rss/hourly/time
## Icons
  j=1
                       
    for (( i=1; i<=5; i+=1 ))
			
      do
		    	
        cp $HOME/accuweather_marens_rss/tad-icons/$(sed -n ${i}p $HOME/accuweather_marens_rss/hourly/images) $HOME/accuweather_marens_rss/hourly/hourly_$j.png
    
  ((j++))
  
  done


exit

now file

Température: 4 °C
Ressentie: 4 °C
Maxi et mini: 8 / 4°C
Low clouds.
Visibilité: 1 km
Pression: 1029 mbar
Humidité: 100%
Point de rosée: 4 °C
Vent: 4 km/h 
from North
Mise @ jour 13 déc 2025, 11 h 00
Nuages bas.
du Nord

date_and_forecast in french if i want to use it

13  Increasing cloudiness.
14  Mostly sunny.
15  Scattered clouds.
16  Overcast.
17  Morning clouds.
18  Morning clouds.
19  Broken clouds.
13 Nébulosité croissante.
14 Généralement ensoleillé.
15 Nuages épars.
16 Couvert.
17 Nuages du matin.
18 Nuages du matin.
19 Nuages brisés.


with vclouds icon pack .

JDCugO6y_t.png

@+

Last edited by loutch (2025-12-13 10:46:16)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#199 2025-12-13 14:06:50

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

^ When the website is switched to MONDAY (tomorrow evening), the date_and_phrase file becomes unusable for the next 24 hours.
That bug was found by @asqwerth.

I fixed it by creating two separate files "date" and "phrase".

Add to the end of the script #### DAY + DATE (Next 7 Days) part:

#### DAY + DATE (Next 7 Days) 
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -s "$address/ext" > $HOME/time_and_date_conky_script/date-raw

cat $HOME/time_and_date_conky_script/date-raw | grep -o '[,^]"ds":"[^"]*' | sed 's/,"ds":"//g' | sed 's/\.//g' | sed -n '1,7p' > $HOME/time_and_date_conky_script/date

Find #### HOURLY and add above that line (it should look like this):

## Phrase (Next 7 Days)
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=mtt title="[^"]*' | sed -n '18,24p' | sed 's/ class=mtt title="//' > $HOME/time_and_date_conky_script/phrase   
  

#### HOURLY

Then translate the new "phrase" file into French.

When the "MONDAY" bug appears tomorrow evening, you will have a solution ready.

---

VClouds icons always look good.
Great job.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#200 2025-12-13 16:03:33

loutch
Member
Registered: 2015-12-12
Posts: 967

Re: Conky Weather TAD script

Re

Oki-doki.


@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

Board footer

Powered by FluxBB