You are not logged in.

#1 2017-01-27 13:03:58

unklar
Member
Registered: 2015-10-31
Posts: 735

[solved]conky and radiotray

Hello everybody,

I recently discovered a radiostation that is exactly the same as my taste.  smile
http://www.radioswisspop.ch/en


With radiotray and the Conky of Sectorr11 wink runs it all day.
Now I would like to present the cover of the title.

On crunchbang I found from dk75 a script, which he wrote especially for the station "lounge-radio".

#!/bin/bash

wget -q http://www.lounge-radio.com/code/pushed_files/now.html -O /tmp/loungeradio.html &&

mawk ' \
	/id="artist"/ {getline; gsub(/<div>|<\/div>|^ +|[\f\n\r]/,""); artist=$0} \
	/id="album"/ {getline; gsub(/<div>|<\/div>|^ +|[\f\n\r]/,""); album=$0} \
	/id="track"/ {getline; gsub(/<div>|<\/div>|^ +|[\f\n\r]/,""); track=$0} \
	END{
		print "${goto 20}Artist:${goto 90}"artist; \
		print "${goto 20}Album:${goto 90}"album; \
		print "${goto 20}Track:${goto 90}"track; \
	} \
	' /tmp/loungeradio.html

wget -q "http://www.lounge-radio.com/code/pushed_files/$(mawk -F"\"" '/id="covercontainer"/ {print $4}' /tmp/loungeradio.html)" -O - | convert - -scale 100x100 /tmp/loungeradio.png &&

echo '${image /tmp/loungeradio.png -p 100,70 -s 100x100}'

exit 

I need only the upper and lower part to cut the cover from the website. The size is 60x60pix.

Artist, album and track I already have in Conky.

Can anyone help?

Last edited by unklar (2017-01-27 20:08:42)

Offline

#2 2017-01-27 14:52:44

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,595

Re: [solved]conky and radiotray

to get a cover url?

wget -qO- http://www.radioswisspop.ch/en | grep "hidden-xs cover" # | more filtering here

maybe

wget -qO- http://www.radioswisspop.ch/en | grep "hidden-xs cover" | grep -o -P '(?<=src=\").*(?=\")'

Last edited by brontosaurusrex (2017-01-27 15:00:25)

Offline

#3 2017-01-27 15:11:28

unklar
Member
Registered: 2015-10-31
Posts: 735

Re: [solved]conky and radiotray

Sorry  ops

http://www.radioswisspop.ch/common/images/booklets/web/050/000/014/14773.jpg

this part changing ../014/14773

2017-01-27-16-34-36_scrot.th.png

Last edited by unklar (2017-01-27 15:39:59)

Offline

#4 2017-01-27 15:53:43

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

Re: [solved]conky and radiotray

Hello

here my script to found cover for all radio stream .It use google image search.



 
#!bin/bash

 
titre=$(head -1 ~/.conky/radiotray/artiste_titre.txt)
lienMiniature=$(wget -U'Googlebot-Image/1.0' -qO - "www.google.fr/search?q=$titre\&tbm=isch" | perl -pe 's!.*?<img .*?src="([^"]*)".*!$1!')
wget -qO miniatureGoogleImage $lienMiniature

convert ~/miniatureGoogleImage ~/.conky/radiotray/pochette.png

here line to make .txt in conkyrc

${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w80 > ~/.conky/radiotray/artiste_titre.txt}

here to have image (i use lua )

${texeci 20 ~/.conky/radiotray/pochette.sh}
${lua fDrawImage ~/.conky/radiotray/pochette.png 24 14 68 70}

RFM with U2 cover

1483130123.png

MAXI 80 beach boys

1485532357.png

@+

Offline

#5 2017-01-27 19:10:09

unklar
Member
Registered: 2015-10-31
Posts: 735

Re: [solved]conky and radiotray

big_smile  big_smile

Thank you very much, @loutch  smile
It's perfect!

2017-01-27-20-03-28_scrot.th.png

Offline

#6 2017-01-27 19:34:18

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

Re: [solved]conky and radiotray

@ unklar

Great  Radio ,adopted.

For once that it is I who can help

@+

Offline

#7 2017-01-27 20:08:01

unklar
Member
Registered: 2015-10-31
Posts: 735

Re: [solved]conky and radiotray

^

@loutch
+1  clapping.gif

Offline

#8 2018-10-01 18:09:13

unklar
Member
Registered: 2015-10-31
Posts: 735

Re: [solved]conky and radiotray

Bonjour loutch,

J'espère que vous lisez encore ici avec

J'ai un problème d'image avec la syntaxe Conky 1.10 (en 1.9 c'est bien)
L'image de la title/couver lue change constamment avec celle de Google et vice-versa.

conky10radiotray.th.png conky10radiotray1.th.png

Vous le connaissez ?
Voici ma configuration:
conkyrc

conky.config = {
	background = true,
	use_xft = true,
	font = 'Liberation Sans:size=8',
	xftalpha = 1,
	update_interval = 1.0,
	total_run_times = 0,
	own_window = true,
	own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
	own_window_type = 'normal',
	own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
	double_buffer = true,
	minimum_width = 200, minimum_height = 180,
--maximum_width 200
	text_buffer_size = 2048,
	draw_shades = false,
	draw_outline = false,
	draw_borders = false,
	draw_graph_borders = false,
	default_color = 'white',
	default_outline_color = 'white',
	alignment = 'top_right',
	gap_x = 70,
	gap_y = 10,
	no_buffers = true,
	uppercase = false,
	cpu_avg_samples = 2,
	override_utf8_locale = true,
imlib_cache_flush_interval = 60,
	imlib_cache_size = 0,


-- Taille des pointillés
	stippled_borders = 5,

-- Couleurs
	default_color = '#ffffff',--ffd579
	default_shade_color = '#333333',
	default_outline_color = 'black',

lua_load = '~/LUA/image.lua',

};

conky.text = [[
${lua fDrawImage ~/.conky/radiotray/images/caset.png 00 00 150 150}
${voffset 120}${if_match "${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w40}" == "Playing"} 
${else}${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w40 }${endif}
${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w40 > ~/.conky/radiotray/artiste_titre.txt}
${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio > ~/.conky/radiotray/logo.txt}
${texeci 5 ~/.conky/radiotray/pochette.sh}${texeci 2 ~/.conky/radiotray/logo.sh}
${if_match "${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w40}" == "Playing"}${lua fDrawImage ~/.conky/radiotray/logo.png 19 19 112 112}
${else}${lua fDrawImage ~/.conky/radiotray/pochette.png 19 19 112 112}${endif}
${voffset -800} 
]];

pochette.sh

 
#!bin/bash
#créé par loutch

 
titre=$(head -1 ~/.conky/radiotray/artiste_titre.txt)
lienMiniature=$(wget -U'Googlebot-Image/1.0' -o /dev/null -O - "www.google.fr/search?q=$titre\&tbm=isch" | perl -pe 's!.*?<img .*?src="([^"]*)".*!$1!')
wget -o /dev/null -O  miniatureGoogleImage $lienMiniature

convert ~/miniatureGoogleImage ~/.conky/radiotray/pochette.png 

logo.sh

 
#!bin/bash
# créé par loutch

 
titre=$(head -1 ~/.conky/radiotray/logo.txt)
lienMiniature=$(wget -U'Googlebot-Image/1.0' -o /dev/null -O - "www.google.fr/search?q=$titre\&tbm=isch" | perl -pe 's!.*?<img .*?src="([^"]*)".*!$1!')
wget -o /dev/null -O Googlelogo $lienMiniature

convert ~/Googlelogo ~/.conky/radiotray/logo.png 

Je vous remercie beaucoup.   smile

Offline

Board footer

Powered by FluxBB