Choose from a nice graphical menu which DI.FM radio station to play

zenity --list --width 500 --height 500 --column 'radio' --column 'url' --print-column 2 $(curl -s | awk -F '"' '/href="http:.*\.pls.*96k/ {print $2}' | sort | awk -F '/|\.' '{print $(NF-1) " " $0}') | xargs mplayer
This is a very simple and lightweight way to play DI.FM stations For a more complete version of the command with proper strings in the menu, try: (couldnt fit in the command field above) zenity --list --width 500 --height 500 --title 'DI.FM' --text 'Pick a Radio' --column 'radio' --column 'url' --print-column 2 $(curl -s | awk -F '"' '/href="http:.*\.pls.*96k/ {print $2}' | sort | awk -F '/|\.' '{print $(NF-1) " " $0}') | xargs mplayer This command line parses the html returned from and display all radio stations in a nice graphical menu. After the radio is chosen, the url is passed to mplayer so the music can start dependencies: - x11 with gtk environment - zenity: simple app for displaying gtk menus (sudo apt-get install zenity on ubuntu) - mplayer: simple audio player (sudo apt-get install mplayer on ubuntu)
Sample Output
$ zenity --list --width 500 --height 500 --title 'DI.FM' --text 'Pick a Radio' --column 'radio' --column 'url' --print-column 2 $(curl -s | awk -F '"' '/href="http:.*\.pls.*96k/ {print $2}' | awk -F '/|\.' '{print $(NF-1) " " $0}') | sort | xargs mplayer
MPlayer UNKNOWN-4.4.1 (C) 2000-2009 MPlayer Team
Failed to open LIRC support. You will not be able to use your remote control.

Resolving for AF_INET6...
Couldn't resolve name for AF_INET6:
Resolving for AF_INET...
Connecting to server[]: 80...
Cache size set to 320 KBytes
Unknown entry type Version=2

Resolving for AF_INET6...
Couldn't resolve name for AF_INET6:
Connecting to server[]: 8016...
Name   : Soulful House - D I G I T A L L Y - I M P O R T E D - house music selected from Paris with love!
Genre  : Electronic Soulful House Deep
Public : yes
Bitrate: 96kbit/s
Cache size set to 320 KBytes
Cache fill:  7.50% (24576 bytes)   
ICY Info: StreamTitle='Elegant & Fabolous - 25 Classic House Anthems and Deep-House Tracks (Victor Hugh - Mine Suburbia (Original)';StreamUrl='';
Cache fill: 10.00% (32768 bytes)   
Audio only file format detected.
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
mpg123: Can't rewind stream by 291 bits!
AUDIO: 44100 Hz, 2 ch, s16le, 96.0 kbit/6.80% (ratio: 12000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
[pulse] working around probably broken pause functionality,
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...

  2.1 (02.0) of -0.0 (unknown)  0.5% 78% 

By: polaco
2010-04-28 23:45:35

What Others Think

This is awesome!
TheShadowFog · 501 weeks and 1 day ago
Installing many sounds is simple and completely free on mobile phones.
MarthaOlwen · 25 weeks and 1 day ago
Download the latest free ringtones for 2021 on the website:
MarthaOlwen · 24 weeks and 2 days ago
Download the latest free ringtones for 2021 on the website
MarthaOlwen · 24 weeks and 2 days ago
Hello everyone has their own views regarding these online games. Here I am sharing my experience of laying online casino games and making my money double. One of my friends suggested me to play these game here . These online games are real money games by which you can earn a lot of money. But you have to be careful while playing. The platform where you are playing must be certified and trustworthy.
KennethIWilliams · 16 weeks and 5 days ago
download de nieuwste 2021 mp3-beltonen nu volledig gratis
vernacarroll · 14 weeks ago
2021 Most Favorite Alarm Download Get Free Access Now sonnerie Totally Spies
TanyaHarrison · 11 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: