You are not logged in.
I have created a nifty browser in Bash. I know it has many flaws, but it just does the job, and quickly too
It basically lets you search for multiple tags and choose the number of results you want to view. Then you can simply select the album and it will start playing straight away.
Please note that my experience in programming is minimal, in fact I'm still learning the basics.
For this script you will need MPD, mpc and w3m. Feel free to improve it, pass it on and such.
I'm also planning to start a project for a more complete Jamendo browser in ncurses. Of course that will be my learning experience for both C and Ncurses
You can get it here.
Enjoy the music!
EDIT: I have updated the script, thanks for all your suggestions, especially Daenyth. You can get it at the same URL.
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Wow. It's working "out of the box" for me, I'm listening to Jamendo right now! I'll read the code and give more feedback in a while. Thank you so much!
Offline
Thank you for trying it out, I'm happy it's working fine for you
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Offline
Yeah! Jamendo is a fantastic project
Thanks for your comment
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
If you're planning an ncurses version, you might want to write it in perl. I see from your script that you're pretty good at bash, sed and awk, and you say you're learning C; perl is like a mix of these languages, but it's very convenient to write and very powerful when it comes to manipulating strings.
Offline
Minimal...functional...your script is....simply ARCH
Great work !
There is one thing even more vital to science than intelligent methods; and that is, the sincere desire to find out the truth, whatever it may be.
Charles S. Peirce
Offline
@ peets
Thanks for the feedback
Actually most of what I managed to do was out of intuition more than experience I know very very little of awk, and just a bit of sed...
Anyway, I don't really like the approach I have used to do this, I find it a bit too trivial (everything is based on the line numbers, rather than on the album ID), and I hope I will not have to manipulate strings that way. I was thinking of learning C primarily because I think it's a good way to get into programming, and also because the Ncurses guide I found always brings parallels with C, and I didn't really understand.
@ Theomachos
Yeah, I love minimalism!
Thanks
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Hey finferflu,
Great script. I'm not a mpd/mpc user so I adjusted the script for moc and it works beautifully.
If anyones interested here's the change:
# play album via moc
mocp -c; mocp -a `w3m -no-cookie -dump \`w3m -no-cookie -dump http://www.jamendo.com/get/album/name/tag/audio/plain/${tag// /+}/?n=$n | sed -n "$number"p\``; mocp -p
Thanks
Last edited by Ashren (2008-01-23 20:00:03)
Offline
Cool! I'm happy to see it's even "portable"
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Thank you, it works well!
Came to this thread from here: http://kmandla.wordpress.com/2008/01/27 … r-project/
Offline
Great script! I also found about it from K. Mandla.
It's not working with mpd for me though..
edit2: i didn't have mpc installed... it works now
Last edited by el mariachi (2008-01-27 09:11:11)
Offline
Hi finferflu !
I'm new on Linux, ubuntu-user.
I installed your program, but received error message:
53: Syntax error: Bad substitution
I have MPD, mpc and w3m.
Thanks for attention !
(Sorry my english...
Maurício
Offline
Maurício, do you get that error every time?
This is line 53 in the version of the script I have:
w3m -no-cookie -dump http://www.jamendo.com/get/album/name/tag/desc1/plain/${tag// /+}/?n=$n > /tmp/jamdump;
The substitution taking place is this: all spaces in the tag you entered are replaced by '+'. It works for me.
Maybe what can go wrong is:
- bad bash version (unlikely)
- bad script version? (I think there's only one... make sure your line 53 is identical to mine)
- some locale/encoding error (accentuated characters, etc. (worked for me when I tried 'é' and 'è')
- something else?
Offline
@ George_K, el mariachi
Thanks for your feedback, I'm happy you liked it
@ mauriicio
I think peets knows more than me, but another suggestion I might add is: how did you "install" the script? If you copied it into a file, check that you didn't add any character into the script by mistake.
Thanks peets for helping out
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Hi guys !
I am new in Linux, I made this:
Copy the program into a file, authorized execution, named "jammpd.sh", and in the terminal, "sh jammpd.sh".
This is correct ?
My line 53 is the same.
I used other scripts, no problem.
Maybe I should install any other program ?
I missed something ?
Thanks for your attention !
Maurício
Offline
Try to run it in this way: from the directory where you have the file, run:
./jammpd.sh
If it still gives you problems, try to remove the .sh from the file name. It works for me like that.
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
YES !!!
Is working !
Thanks !
What's the difference between "./jampd.sh" and "sh jampd.sh" ?
Thanks for attention !!!
Maurício
Offline
I'm not so sure, but I think that you were trying to invoke a bash script with shell. Bash has its own built-ins, which apparently do not always work with plain shell.
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Ok !
I using your program with moc and works !
Thanks for attention !
Peace !
Maurício
Offline
Glad you like it
To inaugurate the event, let me suggest you an album: Gerador Zero - #!/bin/bash.
Enjoy the music
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Very good !
Listen to: www.jamendo.com/en/artist/pedro.collares
Relax sound, I like it too !
Enjoy !
Maurício
Offline
I would suggest to sort the list of albums (at least in case user selected to show all albums):
EDIT: this code is not working because it is not enough
52 # store the list in a temporary file
53 w3m -no-cookie -dump http://www.jamendo.com/get/album/name/tag/desc1/plain/${tag// /+}/?n=$n | ( [ "$n" = "all" ] && sort || cat ) > /tmp/jamdump;
Last edited by George_K (2008-01-29 12:51:30)
Offline
Maybe I will rewrite this script in python.
Offline
Ok, this works:
57 # display a reformatted list with colourised line numbers for easy selection ;)
58 sed = /tmp/jamdump | sed 'N;s/\n/\t/' | ( [ "$n" = "all" ] && sort -k 2 || cat ) | \
(Previous patch of lines 52 and 53 is not needed).
Last edited by George_K (2008-01-29 13:04:21)
Offline