You are not logged in.

#1426 2021-02-11 23:35:28

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,470

Re: Show us your conky

I couldn't get any results with lynx, so I tried with elinks.
Got some results, but I couldn't find any way to get to an image, sorry guys.

EDIT: I'll make one more attempt maybe during the weekend, but it doesn't look good.

Last edited by TeoBigusGeekus (2021-02-14 00:50:50)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1427 2021-02-12 17:47:28

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

^this is good   smile

Offline

#1428 2021-02-15 12:25:15

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

The new Plasma 5.20.5 greets Sector11  devil
once blurred and once in original size, a desktop
(this is a MiG-3 from 1940)

09v8Xbqt.png Ma2r6xlt.png

Offline

#1429 2021-02-16 10:36:00

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,470

Re: Show us your conky

Nope, no way.
Web crawling has become very difficult nowadays...


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1430 2021-02-16 10:52:52

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

^Thanks, Teo   wink

Update:
Teo, one last try... just for me  big_smile

this radio station, this changing cover for a conky, does it look so sad there too ?  hmm

S5s3kE7t.png

Last edited by unklar (2021-02-16 15:35:06)

Offline

#1431 2021-02-16 23:45:35

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,470

Re: Show us your conky

That's a whole different thing and actually easy:

#!/usr/bin/env bash

wget -q -O current_playing "https://www.radioswisspop.ch/en"
sed -i '/<div class="current-airplay">/,/<div class="vol-ctr hidden-md hidden-lg">/!d' current_playing
sed -i -e 's/^.*"titletag">//' -e 's/^.*"artist">//' -e 's/^.*src="//' current_playing
sed -i -e 's/<\/span>//g' -e 's/" \/>//g' -e '/<\|>/d' -e '/^ *$/d' current_playing
wget -q -O current_playing_thumb.jpg "https://www.radioswisspop.ch$(sed -n 1p current_playing)"

Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1432 2021-02-17 07:12:09

ohnonot
...again
Registered: 2015-09-29
Posts: 5,394
Website

Re: Show us your conky

TeoBigusGeekus wrote:

Nope, no way.
Web crawling has become very difficult nowadays...

FWIW, my favourite weather site provides ALL their weather data (and yes, this includes maps and such) in downloadable & parsable formats - I decided to move away from crawling/parsing web pages as much as possible.

Actually, in my specific case, I decided to use the data provided by their mobile services instead.
Example for Kastoria:
https://m.fmi.fi/mobile/interfaces/weat … ons=735927
Nice JSON.

I believe there's also some "Open Weather API" that essentially does the same.

Just pointing out some alternatives.

Last edited by ohnonot (2021-02-17 07:13:08)


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#1433 2021-02-17 18:53:29

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

TeoBigusGeekus wrote:

That's a whole different thing and actually easy:

... yes, for you smile
I was not at home all day. A first test and I see something!
aCe2Qgut.png

Thanks to you. Like was that, you like Ardbeg ?   big_smile


Update:
it looks already quite neat again, however, somewhere is still the worm in it.... (it does not change).  hmm
2021-02-17-21-14-55_scrot.th.png

But that's it for today.  monkey   lol

Last edited by unklar (2021-02-17 20:20:04)

Offline

#1434 2021-02-19 07:41:00

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,470

Re: Show us your conky

@ohnonot
That looks really promising and it will sure constitute a convenient alternative when all other things fail.
The forecast is a bit barebones and only for a couple of days, but it's better than nothing.
I must confess that parsing web pages and following their programmers' peculiarities can get tiresome and frustrating, as the recent example with weather.com has shown.
Web crawling has become a whole science by its own; I'd be happy to use simple apis and xml files, if they were reliable and available to everyone.
I really miss the times when you could open your .cache folder and find the youtube video you've just watched on your web browser...

@unklar
That's because the script has no idea when a new song is played. Perhaps you could have execi download the page every 30sec or 1min or something, but that'd be a bit of an overkill and it could result in your ip being banned from the site...
How do you play the music from the radio station?
EDIT: Ardbeg, yummy...

Last edited by TeoBigusGeekus (2021-02-19 07:44:30)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1435 2021-02-19 14:20:45

ohnonot
...again
Registered: 2015-09-29
Posts: 5,394
Website

Re: Show us your conky

TeoBigusGeekus wrote:

The forecast is a bit barebones and only for a couple of days, but it's better than nothing.

Um. Are you talking about the link I gave you: https://m.fmi.fi/mobile/interfaces/weat … ons=735927 ?
It has 225 (hourly I think) entries from today (Feb 19) until Mar 1. Is that "only a couple days" for you?
The info is what you'd expect from a normal (non-geeky) forecast, except wind gusts are missing, which I'd like to see.
There's a lot of information in the "Smartsymbol" key, it corresponds to the weather icons shown here, so you can translate it to nice text like "partly cloudy and periods of moderate rain".

For the geeky bits, you can get much more info from their Open Data services.
But it's all a bit greek to me... big_smile ...the mobile json stuff is simpler.

I threw together some initial findings here, brainstorming sortof.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#1436 2021-02-19 15:16:57

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,470

Re: Show us your conky

Yeah, you're right, sorry, I mis-scrolled.
Is there a daily forecast as well? Other than an hourly one I mean.
Perhaps it'll come in handy in the future.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1437 2021-02-19 19:35:44

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

TeoBigusGeekus wrote:

@unklar
That's because the script has no idea when a new song is played. Perhaps you could have execi download the page every 30sec or 1min or something, but that'd be a bit of an overkill and it could result in your ip being banned from the site...
How do you play the music from the radio station?

You're right. I didn't even think of that as a Noob, especially since I wanted to shorten the time significantly (3 - 9sec.).

My player is audacious.
This code already satisfies me because it gives me artist and title in conky.

${ecexi 3 audtool current-song-tuple-data title}

I'm just missing the cover, which your script would have to shovel into my $HOME.  wink

EDIT: Ardbeg, yummy...

This ? I would die   devil

Last edited by unklar (2021-02-19 19:43:19)

Offline

#1438 2021-02-20 03:36:57

ohnonot
...again
Registered: 2015-09-29
Posts: 5,394
Website

Re: Show us your conky

TeoBigusGeekus wrote:

Is there a daily forecast as well? Other than an hourly one I mean.

Not for the mobile weather (or I haven't found out how to modify the query).
But OpenData has lots of options to get what you want.

Frankly, I don't believe that it's possible to sum up a whole day's weather in one forecast, one icon.
On their website they use a 3-hourly system, and the "daily" icon is just the one for 1500 hours.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#1439 2021-02-20 15:31:56

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

Re: Show us your conky

Hello guys you know what

"I'M HAPPY VERY HAPPY " my radiotray-ng script is working again .

Not 100% but 97% is ok sometime the cover album is wrong .


@+

Last edited by loutch (2021-02-20 16:56:10)


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.04 lts & 20.04 lts on ASUS Rog STRIX

Offline

#1440 2021-02-21 22:16:34

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,470

Re: Show us your conky

@ohnonot
That's ok. It could be the basis of a future script, sometime, somewhere... tongue

@unklar
Is there a way to know when the radio station changes the song? Does it give a signal to audacious? Can we get a signal when the timer on audacious gets to 00:00:00 for example?
I love Ardbeg, the Uigeadail is the best peated scotch I've ever tasted.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1441 2021-02-21 22:27:40

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

TeoBigusGeekus wrote:

@unklar
Is there a way to know when the radio station changes the song? Does it give a signal to audacious? Can we get a signal when the timer on audacious gets to 00:00:00 for example?

^I'll have to check that out myself first, tomorrow.
I am now here in [Beryllium] and my favorite programs are still missing...   smile

Offline

#1442 2021-02-22 15:32:29

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

TeoBigusGeekus wrote:

    @unklar
    Is there a way to know when the radio station changes the song? Does it give a signal to audacious? Can we get a signal when the timer on audacious gets to 00:00:00 for example?

No, I don't see any way to do that.  neutral
From turning on/playing the radio station it is like an infinite loop. For example, what starts at 00:00:00 runs until you turn it off, say 1 hour and you would see 01:00:00.
There are no interruptions in the sense of a song change.

Far and wide I don't see any player that could implement my request of the radio stream played, with the cover/image.
One must first make the detour --> play + save --> reorganize + play again with player and cover/image.

That's how I understand it, but don't know if I'm correct with that.  smile

Offline

#1443 2021-02-22 20:47:36

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,470

Re: Show us your conky

Then I don't see any other alternative: you should make the script update every 1min.
There will be overlaps and you might not see the album cover for as long as 1min after a song has started, but it's the only way I can think of.
Although I think it's a bit too much to download a whole web page every minute of your uptime...
You could try it with 2min for starters, see how it goes.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1444 2021-02-23 06:49:01

ohnonot
...again
Registered: 2015-09-29
Posts: 5,394
Website

Re: Show us your conky

^ what, why?
The audtool command from post #1437 notifies of song changes, no?
So you only have to store the old song, and comapre that regularly to what the command spits out. When it's different, you start looking for a cover again.

This quick script (requires curl and xmllint) will do it for the 50px version, not sure there's a  bigger one?

#!/bin/sh

exec 2>/dev/null
url="https://www.radioswisspop.ch/en"
echo "$url/$(curl "$url" | xmllint --nonet --html --xpath "string(//div[@class=\"current-airplay\"]//div[@class=\"time-cover-w\"]/img/@src)" -)"

That said, this works only for this one station. There's software that will fetch cover art based on the title/album. I have used glyrc with some success.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#1445 2021-02-23 08:17:41

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

Re: Show us your conky

Hello guy's

Here my radiotray-ng script work fine  not 100% but 97% sure .

#!/bin/bash
#créé par loutch
#2018-12-27 modifier par TeoBigusGeekus et loutch pour radiotray-ng et conky 1.10
#2021-02-20 modifier par nic80 et loutch

qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | grep artist |sed 's/^.*" \: "//' |sed 's/",.*$//' > artiste_titre.txt
qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | grep title  |sed 's/^.*" \: "//' |sed 's/",.*$//' >> artiste_titre.txt
titre=$(cat artiste_titre.txt)
lynx --source -useragent="Googlebot-Image/1.0" "www.google.com/search?q=$titre\&tbm=isch" | perl -pe 's!.*<img .* src="([^"]*)".*!$1!' > lienMiniaturefile
sed -i 's/^.* http\:/http\:/' lienMiniaturefile
sed -i '/gstatic/!d' lienMiniaturefile

lienMiniature=$(cat lienMiniaturefile)
lynx -dump "$lienMiniature" > miniatureGoogleImage

convert miniatureGoogleImage pochette.png

Good

Capture-d-cran-2021-02-20-18-12-21.png

not so good

Capture-d-cran-2021-02-20-18-13-27.png


@+


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.04 lts & 20.04 lts on ASUS Rog STRIX

Offline

#1446 2021-02-23 10:47:16

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

ohnonot wrote:

^ what, why?
The audtool command from post #1437 notifies of song changes, no?
So you only have to store the old song, and comapre that regularly to what the command spits out. When it's different, you start looking for a cover again.

This quick script (requires curl and xmllint) will do it for the 50px version, not sure there's a  bigger one?

#!/bin/sh

exec 2>/dev/null
url="https://www.radioswisspop.ch/en"
echo "$url/$(curl "$url" | xmllint --nonet --html --xpath "string(//div[@class=\"current-airplay\"]//div[@class=\"time-cover-w\"]/img/@src)" -)"

That said, this works only for this one station. There's software that will fetch cover art based on the title/album. I have used glyrc with some success.

^the 50px would be enough for me for now  big_smile
Larger ones also exist and are shown e.g. here.

so, how do I get this into my $HOME ?
I have no idea, but assume here the code must be supplemented

...]/img/@src)" -)"

Offline

#1447 2021-02-23 12:19:53

ohnonot
...again
Registered: 2015-09-29
Posts: 5,394
Website

Re: Show us your conky

unklar wrote:

so, how do I get this into my $HOME ?

It returns the URL to the image itself. Just curl/wget it to your $HOME big_smile


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#1448 2021-02-23 12:28:01

manuel-909
Member
Registered: 2017-10-09
Posts: 94

Re: Show us your conky

Working good A+ loutch......

Offline

#1449 2021-02-23 12:56:40

unklar
Member
From: #! BL
Registered: 2015-10-31
Posts: 1,443

Re: Show us your conky

ohnonot wrote:
unklar wrote:

so, how do I get this into my $HOME ?

It returns the URL to the image itself. Just curl/wget it to your $HOME big_smile

uhm   glasses

Offline

#1450 2021-02-23 17:05:14

ohnonot
...again
Registered: 2015-09-29
Posts: 5,394
Website

Re: Show us your conky

unklar wrote:

uhm   glasses

Not sure what you mean.
Do you need more help?
The miniscript returns the URL to an image - of the current playing song on radioswisspop.
You can download that image with curl or wget.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

Board footer

Powered by FluxBB