You are not logged in.
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!
Online
^this is good
Offline
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!
Online
^Thanks, Teo
Update:
Teo, one last try... just for me
this radio station, this changing cover for a conky, does it look so sad there too ?
Last edited by unklar (2021-02-16 15:35:06)
Offline
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!
Online
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
That's a whole different thing and actually easy:
... yes, for you
I was not at home all day. A first test and I see something!
Thanks to you. Like was that, you like Ardbeg ?
Update:
it looks already quite neat again, however, somewhere is still the worm in it.... (it does not change).
But that's it for today.
Last edited by unklar (2021-02-17 20:20:04)
Offline
@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!
Online
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... ...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
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!
Online
@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.
EDIT: Ardbeg, yummy...
This ? I would die
Last edited by unklar (2021-02-19 19:43:19)
Offline
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
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
@ohnonot
That's ok. It could be the basis of a future script, sometime, somewhere...
@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!
Online
@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...
Offline
@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.
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.
Offline
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!
Online
^ 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
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
not so good
@+
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
^ 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
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
so, how do I get this into my $HOME ?
It returns the URL to the image itself. Just curl/wget it to your $HOME
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
Working good A+ loutch......
Offline
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
uhm
Offline
uhm
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