PDA

Bekijk de volledige versie : last.fm on Asus WL-HDD for Twonky and Madplay



Winne2Koslowski
05-07-2007, 13:49
Hi!

There is a Linux-Client for last.fm and the source is avalable, too.

http://www.lastfm.de/download/?showplatform=Linux
svn://svn.audioscrobbler.net/client

Has anybody tried compiling this for the Asus WL-HDD?

Winne2Koslowski
03-05-2008, 17:55
There also is a perl script available here:

http://www.lastfm.de/group/mpd/forum/16122/_/352797

but i am getting a lot of errors and it does not compile or make.


[admin@Nirvana /]$ perl -MCPAN -e 'install Music::Audioscrobbler::MPD'
CPAN: Storable loaded ok
LWP not available
LWP not available
CPAN: Net::FTP loaded ok
Fetching with Net::FTP:
ftp://cpan.mirror.iphh.net/pub/CPAN/authors/01mailrc.txt.gz
Going to read /opt/.cpan/sources/authors/01mailrc.txt.gz
/bin/gzip: illegal option -- -
BusyBox v1.1.3 (2007.01.01-14:37+0000) multi-call binary

Usage: gzip [OPTION]... [FILE]...

LWP not available
LWP not available
Fetching with Net::FTP:
ftp://cpan.mirror.iphh.net/pub/CPAN/modules/02packages.details.txt.gz
Going to read /opt/.cpan/sources/modules/02packages.details.txt.gz
/bin/gzip: illegal option -- -
BusyBox v1.1.3 (2007.01.01-14:37+0000) multi-call binary

Usage: gzip [OPTION]... [FILE]...

Warning: Your /opt/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your /opt/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
LWP not available
LWP not available
Fetching with Net::FTP:
ftp://cpan.mirror.iphh.net/pub/CPAN/modules/03modlist.data.gz
Going to read /opt/.cpan/sources/modules/03modlist.data.gz
/bin/gzip: illegal option -- -
BusyBox v1.1.3 (2007.01.01-14:37+0000) multi-call binary

Usage: gzip [OPTION]... [FILE]...

Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 29) line 1.
at /opt/lib/perl5/5.8.8/CPAN.pm line 3405
CPAN::Index::rd_modlist('CPAN::Index', '/opt/.cpan/sources/modules/03modlist.data.gz') called at /opt/lib/perl5/5.8.8/CPAN.pm line 3128
CPAN::Index::reload('CPAN::Index') called at /opt/lib/perl5/5.8.8/CPAN.pm line 675
CPAN::exists('CPAN=HASH(0xdf74b4)', 'CPAN::Module', 'Music::Audioscrobbler::MPD') called at /opt/lib/perl5/5.8.8/CPAN.pm line 1841
CPAN::Shell::expandany('CPAN::Shell', 'Music::Audioscrobbler::MPD') called at /opt/lib/perl5/5.8.8/CPAN.pm line 2077
CPAN::Shell::rematein('CPAN::Shell', 'install', 'Music::Audioscrobbler::MPD') called at /opt/lib/perl5/5.8.8/CPAN.pm line 2164
CPAN::Shell::install('CPAN::Shell', 'Music::Audioscrobbler::MPD') called at /opt/lib/perl5/5.8.8/CPAN.pm line 79
CPAN::AUTOLOAD('Music::Audioscrobbler::MPD') called at -e line 1
[admin@Nirvana /]$

How do you install perl scripts? And what is wrong with my zip-program?

Winne2Koslowski
08-05-2008, 13:14
Well nevermind, mpdscribble works fine. (As mentioned in the how to in this forum.)

pitsch
10-09-2008, 00:16
with minor changes based on:
http://www.lastfm.ru/forum/21716/_/288816

preparations:


#install console web browser
ipgk install lynx

#install egrep
ipkg install grep

# use old grep
mv /opt/bin/grep /opt/bin/grepx

#edit your config file
nano /usr/local/root/.bashfm

enter text:


username=hanswurst
password=hackme
mediaplayer="mpc add"

------------------------------------------------
Here follows the fmstart script:
------------------------------------------------


#!/bin/sh

# "fmstart" starts playing last.fm radio. "fmstart"
# should be used before any other bashfm commands are
# given. It obtains the username, password, and
# mediaplayer from the ".bashfm" file. If the password
# present in the file as plain text, it will be md5
# encoded and the plain text version will be removed.
# It then logs in into Last.fm, obtains the audio
# stream URL, and launches the media player. "fmstart"
# takes no command arguments.

username=`cat ~/.bashfm | grep "^username="`
username=`expr "$username" : 'username=\(.*\)'`

password=`cat ~/.bashfm | grep "^password="`
password=`expr "$password" : 'password=\(.*\)'`
password=`echo -n "$password" | sed -e 's/[ ]*$//'`

mediaplayer=`cat ~/.bashfm | grep "^mediaplayer="`
mediaplayer=`expr "$mediaplayer" : 'mediaplayer=\(.*\)'`
mediaplayer=`echo -n "$mediaplayer" | tr '\' '/'`

if [ ! -z "$password" ]
then
passwordmd5=`echo -n $password | md5sum`
passwordmd5=`expr "$passwordmd5" : '\([0-9A-Fa-f]*\)\.*'`
else
passwordmd5=`cat ~/.bashfm | grep "^passwordmd5="`
passwordmd5=`expr "$passwordmd5" : 'passwordmd5=\(.*\)'`
fi

echo 'username='$username > ~/.bashfm
echo 'password=' >> ~/.bashfm
echo 'mediaplayer='"$mediaplayer" >> ~/.bashfm

echo 'passwordmd5='$passwordmd5 >> ~/.bashfm

login_url='http://ws.audioscrobbler.com/radio/handshake.php?'
login_url="$login_url"'version=1.1.1&platform=linux&username='
login_url="$login_url"$username'&passwordmd5='$passwordmd5
login_url="$login_url"'&debug=0&partner='

echo "login_url=$login_url" >> ~/.bashfm

lynx -source "$login_url" >> ~/.bashfm
echo >> ~/.bashfm

stream_url=`cat ~/.bashfm | grep "^stream_url="`
stream_url=`expr "$stream_url" : 'stream_url=\(.*\)'`

"$mediaplayer" "$stream_url" &

---------------------------------------------
Here follows the "fmtag" script
---------------------------------------------


#!/bin/sh

# "fmtag" plays the music corresponding to the tag given
# as command argument. The tag needs to be quoted when
# it contains spaces.
#
# Example:
# fmtag 'netlabel'

tag=`echo $1 | sed 's/ /%20/g'`

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

tuning_url='http://ws.audioscrobbler.com/radio/adjust.php?'
tuning_url="$tuning_url"'session='$session'&url=lastfm://'
tuning_url="$tuning_url"'globaltags/'$tag'&debug=0'

lynx -source "$tuning_url" > /dev/null

--------------------------------------------
Here follows the "fmart" script.
--------------------------------------------


#!/bin/sh

# "fmart" plays the radio station corresponding to a
# certain artist. It takes the artist's name as command
# line argument. Use quotes when the artist's name
# contains spaces.
#
# Example:
# fmart 'jahcoozi'

artist=`echo $1 | sed 's/ /%20/g'`

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

tuning_url='http://ws.audioscrobbler.com/radio/adjust.php?'
tuning_url="$tuning_url"'session='$session'&url=lastfm://artist/'
tuning_url="$tuning_url"$artist'/similarartists&debug=0'

lynx -source "$tuning_url" > /dev/null

-------------------------------------------------
Here follows the "fmbor" script.
-------------------------------------------------


#!/bin/sh

# "fmbor" plays your neighbourhood radio. "fmbor" takes
# no command line arguments.

username=`cat ~/.bashfm | grep "^username="`
username=`expr "$username" : 'username=\(.*\)'`

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

tuning_url='http://ws.audioscrobbler.com/radio/adjust.php?'
tuning_url="$tuning_url"'session='$session'&url=lastfm://user/'
tuning_url="$tuning_url"$username'/neighbours&debug=0'

lynx -source "$tuning_url" > /dev/null

---------------------------------------
Here follows the "fminfo" script
---------------------------------------


#!/bin/sh

# "fminfo" returns the name of the artist, name
# of the song and name of the album of the music
# that is currently playing. "fminfo" takes no
# command line arguments.

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

info_url='http://ws.audioscrobbler.com/radio/np.php?'
info_url="$info_url"'session='$session'&debug=0'

lynx -source "$info_url" | egrep '(^artist=|^track=|^album=)'

---------------------------------------
Here follows the "fmskip" script
---------------------------------------


#!/bin/sh

# "fmskip" skips the song that is currently playing.
# It takes no command line arguments.

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

skip_url='http://ws.audioscrobbler.com/radio/control.php?'
skip_url="$skip_url"'session='$session'&command=skip&debug=0'

lynx -source "$skip_url"
echo

-----------------------------------------
Here follows the "fmlove" script
-----------------------------------------


#!/bin/sh

# "fmlove" adds the song that is currently playing to
# the list of loved songs. "fmlove" takes no command
# line arguments.

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

love_url='http://ws.audioscrobbler.com/radio/control.php?'
love_url="$love_url"'session='$session'&command=love&debug=0'

lynx -source "$love_url"
echo

--------------------------------------------
Here follows the "fmban" script.
--------------------------------------------


#!/bin/sh

# "fmban" bans the current song from your radio. "fmban"
# takes no command line arguments.

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

ban_url='http://ws.audioscrobbler.com/radio/control.php?'
ban_url="$ban_url"'session='$session'&command=ban&debug=0'

lynx -source "$ban_url"
echo


use mpc or ncmpc for starting to play the stream with mpd...

pitsch
17-09-2008, 19:44
mpdscribble install
----------------------

# install package
ipkg install mpdscribble

mkdir /opt/etc/mpdscribble

ln -s /opt/etc/mpdscribble/ ~/.mpdscribble

echo -n "your_lastfm_password" | md5sum

nano /opt/etc/mpdscribble/mpdscribble.conf

# edit this
username ="lastfm_username"
password="copy md5code here"
# log = /opt/var/mpdscribble/log
cache = /opt/var/mpdscribble/cache
# host = localhost
# port = 6600
verbose = 1
sleep = 30

# startup script
nano /opt/etc/init.d/S95mpdscribble

------------------------------------------------------------------------

#!/opt/bin/sh

PATH=/opt/bin:/opt/sbin:/usr/sbin:/usr/bin:/sbin:/bin
DAEMON=/opt/bin/mpdscribble
NAME=mpdscribble
DESC="mpdscribble -- an mpd audioscrobbler"
PIDFILE=/var/run/mpdscribble.pid

start() {
if [ -f $PIDFILE ]; then
echo "Warning : $PIDFILE still present. Unclean shutdown ?"
kill -s 9 `cat $PIDFILE` 2>/dev/null
rm -f $PIDFILE 2>/dev/null
fi
echo -n "Starting $DESC... "
$DAEMON &
pidof $DAEMON > $PIDFILE
echo "done"
}

stop() {
echo -n "Stopping $DESC... "
if [ -f $PIDFILE ]; then
cat $PIDFILE
kill -9 `cat $PIDFILE` 2>/dev/null
killall -9 $NAME
rm -f $PIDFILE 2>/dev/null
fi
echo "done"
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 1
start
;;

*)
echo "Usage: $0 (start|stop|restart)"
exit 1
;;
esac


----------------------------------------------------------------------
# make executable
chmod +x /opt/etc/init.d/S95mpdscribble

# start with
sh /opt/etc/init.d/S95mpdscribble start

issues:
crossfading is not fully supported
check the errors in log file... look for mpdscribble.log
strangely there are always two threads running using about 12% of memory together

cross compilation whishlist:

mpd / oleg feed is missing a id3 tagging tool:
id3tool, id3v2, mid3v2, id3info, id3cp

scmpd, an alternative audioscrobbler client
http://scmpc.berlios.de/

pitsch
17-09-2008, 19:56
http://mpd.wikia.com/wiki/Hack:bashfm

Last fm streaming client for the busybox shell

source: http://www.last.fm/group/LastBASH/forum/43627/_/236797

preparations:

lynx and egrep are needed

alternative solution: http://files.viharpander.dk/bash/mc/mcf


nano /usr/local/root/.bashfm

username=SECRET
password=SECRET
mediaplayer="mpc add"



Here follows the fmstart script:

#!/usr/bin/bash

# "fmstart" starts playing last.fm radio. "fmstart"
# should be used before any other bashfm commands are
# given. It obtains the username, password, and
# mediaplayer from the ".bashfm" file. If the password
# present in the file as plain text, it will be md5
# encoded and the plain text version will be removed.
# It then logs in into Last.fm, obtains the audio
# stream URL, and launches the media player. "fmstart"
# takes no command arguments.

username=`cat ~/.bashfm | grep "^username="`
username=`expr "$username" : 'username=\(.*\)'`

password=`cat ~/.bashfm | grep "^password="`
password=`expr "$password" : 'password=\(.*\)'`
password=`echo -n "$password" | sed -e 's/[ ]*$//'`

mediaplayer=`cat ~/.bashfm | grep "^mediaplayer="`
mediaplayer=`expr "$mediaplayer" : 'mediaplayer=\(.*\)'`
mediaplayer=`echo -n "$mediaplayer" | tr '\' '/'`

if [ ! -z "$password" ]
then
passwordmd5=`echo -n $password | md5sum`
passwordmd5=`expr "$passwordmd5" : '\([0-9A-Fa-f]*\)\.*'`
else
passwordmd5=`cat ~/.bashfm | grep "^passwordmd5="`
passwordmd5=`expr "$passwordmd5" : 'passwordmd5=\(.*\)'`
fi

echo 'username='$username > ~/.bashfm
echo 'password=' >> ~/.bashfm
echo 'mediaplayer='"$mediaplayer" >> ~/.bashfm

echo 'passwordmd5='$passwordmd5 >> ~/.bashfm

login_url='http://ws.audioscrobbler.com/radio/handshake.php?'
login_url="$login_url"'version=1.1.1&platform=linux&username='
login_url="$login_url"$username'&passwordmd5='$passwordmd5
login_url="$login_url"'&debug=0&partner='

echo "login_url=$login_url" >> ~/.bashfm

lynx -source "$login_url" >> ~/.bashfm
echo >> ~/.bashfm

stream_url=`cat ~/.bashfm | grep "^stream_url="`
stream_url=`expr "$stream_url" : 'stream_url=\(.*\)'`

"$mediaplayer" "$stream_url" &

Here follows the "fmtag" script

#!/usr/bin/bash

# "fmtag" plays the music corresponding to the tag given
# as command argument. The tag needs to be quoted when
# it contains spaces.
#
# Example:
# fmtag 'netlabel'

tag=`echo $1 | sed 's/ /%20/g'`

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

tuning_url='http://ws.audioscrobbler.com/radio/adjust.php?'
tuning_url="$tuning_url"'session='$session'&url=lastfm://'
tuning_url="$tuning_url"'globaltags/'$tag'&debug=0'

lynx -source "$tuning_url" > /dev/null


Here follows the "fmart" script.

#!/usr/bin/bash

# "fmart" plays the radio station corresponding to a
# certain artist. It takes the artist's name as command
# line argument. Use quotes when the artist's name
# contains spaces.
#
# Example:
# fmart 'jahcoozi'

artist=`echo $1 | sed 's/ /%20/g'`

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

tuning_url='http://ws.audioscrobbler.com/radio/adjust.php?'
tuning_url="$tuning_url"'session='$session'&url=lastfm://artist/'
tuning_url="$tuning_url"$artist'/similarartists&debug=0'

lynx -source "$tuning_url" > /dev/null



Here follows the "fmbor" script.

#!/usr/bin/bash

# "fmbor" plays your neighbourhood radio. "fmbor" takes
# no command line arguments.

username=`cat ~/.bashfm | grep "^username="`
username=`expr "$username" : 'username=\(.*\)'`

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

tuning_url='http://ws.audioscrobbler.com/radio/adjust.php?'
tuning_url="$tuning_url"'session='$session'&url=lastfm://user/'
tuning_url="$tuning_url"$username'/neighbours&debug=0'

lynx -source "$tuning_url" > /dev/null



Here follows the "fminfo" script

#!/usr/bin/bash

# "fminfo" returns the name of the artist, name
# of the song and name of the album of the music
# that is currently playing. "fminfo" takes no
# command line arguments.

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

info_url='http://ws.audioscrobbler.com/radio/np.php?'
info_url="$info_url"'session='$session'&debug=0'

lynx -source "$info_url" | egrep '(^artist=|^track=|^album=)'


Here follows the "fmskip" script

#!/usr/bin/bash

# "fmskip" skips the song that is currently playing.
# It takes no command line arguments.

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

skip_url='http://ws.audioscrobbler.com/radio/control.php?'
skip_url="$skip_url"'session='$session'&command=skip&debug=0'

lynx -source "$skip_url"
echo



Here follows the "fmlove" script

#!/usr/bin/bash

# "fmlove" adds the song that is currently playing to
# the list of loved songs. "fmlove" takes no command
# line arguments.

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

love_url='http://ws.audioscrobbler.com/radio/control.php?'
love_url="$love_url"'session='$session'&command=love&debug=0'

lynx -source "$love_url"
echo


Here follows the "fmban" script

#!/usr/bin/bash

# "fmban" bans the current song from your radio. "fmban"
# takes no command line arguments.

session=`cat ~/.bashfm | grep "^session="`
session=`expr "$session" : 'session=\(.*\)'`

ban_url='http://ws.audioscrobbler.com/radio/control.php?'
ban_url="$ban_url"'session='$session'&command=ban&debug=0'

lynx -source "$ban_url"
echo

the
10-04-2010, 21:25
Is this topic alive?

I would like to setup my wl500g for Last.fm but unfortunately I don't understand how a router may help with playing internet radio having neither mediaplayer nor even sound sub-system onboard.

I do understand the concept of using lastfmproxy, which just a proxy server for the last.fm radio streams and a router doesn't have to be aware of sound capabilities

Could anyone please hint me how a router might be used with the below mentioned bashfm?