You are not logged in.

#161 2025-12-07 03:16:35

asqwerth
Member
Registered: 2015-10-08
Posts: 51

Re: Conky Weather TAD script

seatommyboy wrote:

Looks like there is a whole new set of scripts for conky weather. anybody care to share a link please?

I'm still helping marens test the script, which reads weather from timeanddate.com  [ie "tad"].

If we can confirm it works over tad's data changeover every Monday, I'm sure marens will post a finalised version of the script here.

@marens, noted on the script changes.  New script appears ok for now.

Offline

#162 2025-12-07 18:50:50

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

Re: Conky Weather TAD script

Conky tad script

Testing completed successfully.
The 'MONDAY' bug has been resolved.

These are screenshots from a few hours ago and the date_and_phrase  file was working as expected:

tad-before.png  before.png

I don't know exactly when the website switched to tomorrow's forecast, but the date_and_phrase  file is now unusable.
My solution with a separate "phrase" file continued to work properly:
https://forums.bunsenlabs.org/viewtopic … 18#p147418

tad-after.png  after.png

If you use a separate section for "phrase" (and date), you can remove (if you want) ## Daily Date + Phrase - Next 7 Days  from the script.

Remove:

## Daily Date + Phrase - Next 7 Days

cat $HOME/time_and_date_conky_script/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/time_and_date_conky_script/date_and_phrase

cat $HOME/time_and_date_conky_script/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/time_and_date_conky_script/date_and_phrase

cat $HOME/time_and_date_conky_script/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/time_and_date_conky_script/date_and_phrase

cat $HOME/time_and_date_conky_script/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/time_and_date_conky_script/date_and_phrase

cat $HOME/time_and_date_conky_script/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/time_and_date_conky_script/date_and_phrase

cat $HOME/time_and_date_conky_script/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/time_and_date_conky_script/date_and_phrase

cat $HOME/time_and_date_conky_script/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/time_and_date_conky_script/date_and_phrase

Delete the file date_and_phrase.

Done.


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

Offline

#163 2025-12-07 19:32:20

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

Re: Conky Weather TAD script

asqwerth wrote:

I'm sure marens will post a finalised version of the script here.

Maybe, but it won't happen soon.

The TAD website adapts content to local conditions, uses different units, and displays content differently from country to country.
I would have to avoid all that in the NOW section, but that's not on my to-do list (for now).
It was more important to me that the people who contributed to the testing get a script that works the way they wanted.

Thank you for catching the 'MONDAY' bug and for the great work with the WU icons.


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

Offline

#164 2025-12-08 09:56:38

asqwerth
Member
Registered: 2015-10-08
Posts: 51

Re: Conky Weather TAD script

Re: tad script

Everything looks ok after the Monday data changeover.  The "phrase" file is properly generated with textual weather conditions.

Offline

#165 2025-12-09 01:27:21

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

Re: Conky Weather TAD script

marens wrote:
asqwerth wrote:

I'm sure marens will post a finalised version of the script here.

Maybe, but it won't happen soon.

@marens, even if you haven't finalised the script (if that's ever going to happen), I'm requesting that you either post the current script here, or else a link to it, so all people who are interested can follow along and contribute.

Right now it gives the impression that an "inner circle" is working on it. That's not my understanding of the FOSS way.


...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

#166 2025-12-09 02:32:40

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

Re: Conky Weather TAD script

@johnraff

marens wrote:

The TAD website adapts content to local conditions, uses different units, and displays content differently from country to country.

This is where it all started:
https://forums.bunsenlabs.org/viewtopic … 05#p146305

Those interested must start from the beginning and follow the posts.

Everyone who participated in the testing had a different result.
I had to help each of them.

There is no tad script (for now) that works well for all locations.

I'm always ready to help, but I'm not a wizard.
There is no "inner circle" here and nothing is hidden.


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

Offline

#167 2025-12-09 02:58:11

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

Re: Conky Weather TAD script

marens wrote:

There is no "inner circle" here and nothing is hidden.

Then what does this mean?

asqwerth wrote:
seatommyboy wrote:

Looks like there is a whole new set of scripts for conky weather. anybody care to share a link please?

I'm still helping marens test the script, which reads weather from timeanddate.com  [ie "tad"].
If we can confirm it works over tad's data changeover every Monday, I'm sure marens will post a finalised version of the script here.

asqwerth wrote:

Re: tad script
Everything looks ok after the Monday data changeover.  The "phrase" file is properly generated with textual weather conditions.

marens wrote:
asqwerth wrote:

I'm sure marens will post a finalised version of the script here.

Maybe, but it won't happen soon.

So at least two people are discussing a "script" which nobody else has access to.

Either put the code here, or if it's too big for that,  in a git repository where the changes and history are open for all to see.


...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

#168 2025-12-09 03:52:56

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

Re: Conky Weather TAD script

johnraff wrote:

So at least two people are discussing a "script" which nobody else has access to.

I think you owe me an apology.
I don't know how you came to that conclusion, but it's wrong.

@asqwerth just followed all my posts about the tad script here because he was interested:
https://forums.bunsenlabs.org/viewtopic … 87#p147087

He got an answer to every question, just like everyone else.

johnraff wrote:

Either put the code here, or if it's too big for that, in a git repository where the changes and history are open for all to see.

I'm not a developer and I'm not interested.

All my posts about tad script are here on the BL forums.
If someone is interested (like @asqwerth was), they can be easily found.


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

Offline

#169 2025-12-09 04:48:37

asqwerth
Member
Registered: 2015-10-08
Posts: 51

Re: Conky Weather TAD script

I think the evolution of the tad script truly started from this post:

https://forums.bunsenlabs.org/viewtopic … 05#p146305

after it was accepted that Accuweather RSS service is gone.  Marens proposed a script that read from timeanddate.com

I don't want to be caught between marens and other forum members and offend either side, so I will state that if you follow the posts from the post I linked to above, there will be refinements to marens' original script, as well as some conky configs (or useful lines from such configs) that use it.  He also provided weather icons from the timeanddate.com site.

On my own part, I repurposed the Weather Underground icons to be used with the script.  This can be found in this post: https://forums.bunsenlabs.org/viewtopic … 27#p147327

This is my conky config that works with the latest iteration of the tad script: (screenshot link: https://i.imgur.com/YpsgzO4.png)

You will need the monofur font, and the moongiant script as well.

conky.config = {

	own_window = true,
	own_window_type = 'normal',
	own_window_transparent = false,
	own_window_colour = '#000000',
	own_window_hints = 'skip_taskbar,skip_pager,below,undecorated',
	own_window_argb_visual = true,
	own_window_argb_value = 130,
	own_window_class = 'Conky',

	override_utf8_locale = true,
	use_xft = true,
	font = 'Open Sans Light:size=9',
	xftalpha = 1.0,

	draw_borders = false,
	border_inner_margin = 0,
	border_outer_margin = 0,

	background = false,
	use_spacer = 'none',
	no_buffers = true,
	double_buffer = true,

	update_interval = 1,

--################################################################
	minimum_width = 275, minimum_height = 300,
--maximum_width 270

--alignment top_left
alignment = 'top_right',
--	alignment = 'bottom_left',
--	alignment = 'bottom_right',
	gap_x = 850,
	gap_y = 5,

	draw_shades = false,
	default_shade_color = '#292421',
	draw_outline = false,
	draw_borders = false,

	stippled_borders = 0,
	draw_graph_borders = false,
	border_width = 0,

	imlib_cache_size = 0,

	color1 = '#323232',
	color2 = '#E8EF67',
	color3 = '#000000',
	color4 = '#e4490e',
	color5 = '#6db9d5',
	color6 = '#ffffff',
	color7 = '#000000',


};

conky.text = [[
${texeci 900 bash $HOME/time_and_date_conky_script/tad}\
${voffset 14}${goto 20}${color6}${font monofur:size=45}${voffset }${goto 140}${color4}${execpi 600 sed -n '1p'  $HOME/time_and_date_conky_script/now | awk '{print $2}'}°C
${voffset -11}${goto 16}${color5}${font monofur:size=10}CURRENTLY:
${goto 13}${color6}${execpi 300 sed -n '4p' $HOME/time_and_date_conky_script/now | fmt -w 25 | sed -n '1p'}
${goto 13}${execpi 300 sed -n '4p' $HOME/time_and_date_conky_script/now | fmt -w 25 | sed -n '2p'}
\
${goto 16}${color5}${font monofur:size=10}AS AT: 
${goto 13}${color6}${time %H}:${time %M}h, ${time %d} ${time %b %Y}

${goto 16}${color5}${font monofur:size=10}NEXT 3 HOURS:
${goto 13}${color6}${execpi 300 sed -n '1p' $HOME/time_and_date_conky_script/hourly/time}\
${goto 105}${color6}${execpi 300 sed -n '2p' $HOME/time_and_date_conky_script/hourly/time}\
${goto 200}${color6}${execpi 300 sed -n '3p' $HOME/time_and_date_conky_script/hourly/time}\

${goto 13}${color5}${execpi 300 sed -n '1p'  $HOME/time_and_date_conky_script/hourly/temperature}\
${goto 105}${color5}${execpi 300 sed -n '2p'  $HOME/time_and_date_conky_script/hourly/temperature}\
${goto 200}${color5}${execpi 300 sed -n '3p'  $HOME/time_and_date_conky_script/hourly/temperature}\





${font monofur:size=10}${if_match "${execi 600 sed -n '1p' $HOME/time_and_date_conky_script/date | awk '{print $1}'}" == "Sat,"}${color FFFF00}\
${else}\
${if_match "${execi 600 sed -n '1p' $HOME/time_and_date_conky_script/date | awk '{print $1}'}" == "Sun,"}${color FFFF00}\
${else}${color5}${endif}${endif}\
${goto 16}${font monofur:size=10}${execi 600 sed -n '1p'  $HOME/time_and_date_conky_script/date}${color}
${goto 16}${font}${goto 75}${voffset }${color4}${font monofur:size=10}High and Low: ${execpi 600 sed -n '1p'  $HOME/time_and_date_conky_script/temperatures}°C
${goto 85}${color6}${execpi 600 sed -n '1p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $1}' | sed 's/.*/&./'}
${if_match "${execpi 600 sed -n '1p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $2}' | sed 's/^[ \t]*//' | sed 's/.*/&./'}" != "."}${goto 85}${color6}${execpi 600 sed -n '1p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $2}' | sed 's/^[ \t]*//' | sed 's/.*/&./'}\
${else}${endif}

${font monofur:size=10}${if_match "${execi 600 sed -n '2p' $HOME/time_and_date_conky_script/date | awk '{print $1}'}" == "Sat,"}${color FFFF00}\
${else}\
${if_match "${execi 600 sed -n '2p' $HOME/time_and_date_conky_script/date | awk '{print $1}'}" == "Sun,"}${color FFFF00}\
${else}${color5}${endif}${endif}\
${goto 16}${font monofur:size=10}${execi 600 sed -n '2p'  $HOME/time_and_date_conky_script/date}
${goto 16}${font}${goto 75}${voffset }${color4}${font monofur:size=10}High and Low: ${execpi 600 sed -n '2p'  $HOME/time_and_date_conky_script/temperatures}°C
${goto 85}${color6}${execpi 600 sed -n '2p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $1}' | sed 's/.*/&./'}
${if_match "${execpi 600 sed -n '2p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $2}' | sed 's/^[ \t]*//' | sed 's/.*/&./'}" != "."}${goto 85}${color6}${execpi 600 sed -n '2p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $2}' | sed 's/^[ \t]*//' | sed 's/.*/&./'}\
${else}${endif}

${font monofur:size=10}${if_match "${execi 600 sed -n '3p' $HOME/time_and_date_conky_script/date | awk '{print $1}'}" == "Sat,"}${color FFFF00}\
${else}\
${if_match "${execi 600 sed -n '3p' $HOME/time_and_date_conky_script/date | awk '{print $1}'}" == "Sun,"}${color FFFF00}\
${else}${color5}${endif}${endif}\
${goto 16}${font monofur:size=10}${execi 600 sed -n '3p'  $HOME/time_and_date_conky_script/date}
${goto 16}${font}${goto 75}${voffset }${color4}${font monofur:size=10}High and Low: ${execpi 600 sed -n '3p'  $HOME/time_and_date_conky_script/temperatures}°C
${goto 85}${color6}${execpi 600 sed -n '3p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $1}' | sed 's/.*/&./'}
${if_match "${execpi 600 sed -n '3p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $2}' | sed 's/^[ \t]*//' | sed 's/.*/&./'}" != "."}${goto 85}${color6}${execpi 600 sed -n '3p' $HOME/time_and_date_conky_script/phrase | awk -F'.' '{print $2}' | sed 's/^[ \t]*//' | sed 's/.*/&./'}\
${else}${endif}
\
${image $HOME/time_and_date_conky_script/0.png  -p 9,10 -s 90x90 -f 300}\
${image $HOME/time_and_date_conky_script/wind_0.png -p 180,70 -s 60x60 -f 300}\
${texeci 500 bash $HOME/Moongiant_conky_script/moongiant}${image $HOME/Moongiant_conky_script/0.png -p 191,130 -s 40x40 -f 300}\
${image $HOME/time_and_date_conky_script/hourly/hourly_1.png -p 15,230 -s 40x40 -f 300}\
${image $HOME/time_and_date_conky_script/hourly/hourly_2.png -p 108,230 -s 40x40 -f 300}\
${image $HOME/time_and_date_conky_script/hourly/hourly_3.png -p 202,230 -s 40x40 -f 300}\

${image $HOME/time_and_date_conky_script/day_1.png -p 10,300 -s 60x60 -f 300}\
${image $HOME/time_and_date_conky_script/day_2.png -p 10,373 -s 60x60 -f 300}\
${image $HOME/time_and_date_conky_script/day_3.png -p 10,445 -s 60x60 -f 300}\
${voffset -1}
]];

Offline

#170 2025-12-09 06:19:51

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

Re: Conky Weather TAD script

I see people asking for the latest version of the script and being told to wait for an indefinite time, or else go back and check over the last ~160 posts.

@marens if you don't want to use git that's OK but why not at least either regularly post updated scripts or - maybe better - put the latest version of the script in some central location where anybody can see it, as unklar suggested:

unklar wrote:

I'm just wondering whether it wouldn't be better to place additions/improvements/changes to the script in a central location?
Similar to what @TBG did, your scripts are in a specific location. It's just damn annoying to find the individual posts.
I think @johnraff definitely doesn't mind.  wink

@marens, please think about it... 
yes, and the entire current tad script wouldn't be bad for me now.  tongue   Thanks!

It really is annoying to be expected to plough through a thread that has grown to 4793 posts!
...or even just the last 160 posts.


...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

#171 2025-12-09 09:53:21

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

Re: Conky Weather TAD script

Hello

Accuweather_conky_script & marens_hourly (wind rose & sunrise use openweather)

rl6icX2w_t.png

@+


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

Online

#172 2025-12-09 10:08:50

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

Re: Conky Weather TAD script

@johnraff

Thanks for the advice, but that's not possible.

Everyone who participated in the testing is now using different scripts.

marens wrote:

The TAD website adapts content to local conditions, uses different units, and displays content differently from country to country.

I spent hours trying to help everyone.
Instead of gratitude, I was accused of hiding something.

I hope you understand why I will not continue with this topic.
Anyone who wants to can freely continue my work.


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

Offline

#173 2025-12-10 02:11:27

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

Re: Conky Weather TAD script

This is now an independent topic, named "Conky TAD script", starting from marens' post of 2025-10-22 ie the OP of this thread: https://forums.bunsenlabs.org/viewtopic … 05#p146305

Because the OP is marens' post he can edit the title as he wishes, or add any additional information that might help people who have newly arrived eg links to important posts.

The  Conky weather+moon scripts thread started by TeoBigusGeekus, having run to over 4,600 posts, will now be closed. It will remain on the forum as an archive of valuable reference material.

Anyone who wants to discuss other conky weather scripts, please start a new thread. smile


...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

#174 2025-12-10 07:24:05

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,788

Re: Conky Weather TAD script

^ Thank you, @johnraff, for this wise decision!  wink

Offline

#175 2025-12-10 10:10:54

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

Re: Conky Weather TAD script

Hello

It still works for me since the beginning, no errors. Conky and the website give the same information.

2QdcNBgj_t.png

Tanks.

@+


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

Online

#176 2025-12-11 03:12:41

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

Re: Conky Weather TAD script

@johnraff

I agree.
Maybe I should have done it right away, but I didn't expect to go step by step and end up with a complete weather forecast (Now, Hourly, Daily).

You didn't go into details, but the biggest problem is that the data is displayed differently from country to country.
If I open your location from here, I'll get a different result than if someone from Japan did.
The same thing happens here in Europe or in the US, everything differs from country to country.

It is pointless to continue creating a new script for every interested forum member.

However, tonight I tried to be smarter with HTML code and units.
For the reasons above, I can't test it from here, but if you're not busy, 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?

Note *
I ask everyone who already uses the TAD script to try the same.
Just replace @johnraff's location with yours in the first command.

Last edited by marens (2025-12-11 04:02:41)


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

Offline

#177 2025-12-11 04:07:45

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

Re: Conky Weather TAD script

^thanks marens. I'm really busy today but I'll try that tomorrow.


...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

#178 2025-12-11 08:34:50

asqwerth
Member
Registered: 2015-10-08
Posts: 51

Re: Conky Weather TAD script

@marens

Carried out your test.  OK on my end.

The tad script is continuing to work fine.

Offline

#179 2025-12-11 09:21:47

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

Re: Conky Weather TAD script

Hello


Same by me .

As always great job.

@+


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

Online

#180 2025-12-11 11:05:20

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

Re: Conky Weather TAD script

@loutch
@asqwerth

Thanks guys.
Let's wait and see @johnraff's result for Japan (Nagoya).

I think I will easily make a TAD script later that works for all locations.

If you want to test, you can make a copy of the existing TAD script, then replace the entire #### NOW  section with:

#### NOW

## 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>//' >> $HOME/time_and_date_conky_script/now

@loutch

I think in the meantime I solved the bug you had with the "time" file in the hourly forecast.

Replace:

## Hourly Time
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^ ]*' | awk -F'</td><td>' '{print $2}' > $HOME/time_and_date_conky_script/hourly/time

cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^ ]*' | awk -F'</td><td>' '{print $3}' >> $HOME/time_and_date_conky_script/hourly/time

cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^ ]*' | awk -F'</td><td>' '{print $4}' >> $HOME/time_and_date_conky_script/hourly/time

cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^ ]*' | awk -F'</td><td>' '{print $5}' >> $HOME/time_and_date_conky_script/hourly/time

cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^ ]*' | awk -F'</td><td>' '{print $6}' | sed 's/<\/td><\/tr><tr//' >> $HOME/time_and_date_conky_script/hourly/time

With just one line:

## Hourly 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

Restart conky and check the file ~/time_and_date_conky_script/hourly/time.
Is the time in the same format as on the website?

It looks different in France than when I try it from here.

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


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

Offline

Board footer

Powered by FluxBB