Citat:
Ursprungligen postat av harring
De första 2 koderna är för cover art, första koden i en image och andra i en shell
file://localhost/tmp/coverart.jpg
#Cover art updater
c=`ps -x |grep -c "Spotify.app"`
if [ "$c" != "1" ]
then
osascript -e 'tell application "GeekTool" to set the width of (every image geeklet whose name contains "spotify") to 115'
lastSong=`cat /tmp/lastsong`
x=`cat /var/log/system.log |grep Spotify |sed "s/^.*Spotify: //g" |sed "s/\\\\\\n/ <-> /g" |sed "s/ - Priority [0-9]//g" |sed -E "s/^.*(http:\/\/|[sS]potify).*$/Reklam (Reklam<->Reklam)/" |sed '$!d'`
if [ "$x" != "$lastSong" ]
then
echo $x > /tmp/lastsong
artist=`echo $x |sed "s/.*(\(.*\)<->.*/\1/"`
album=`echo $x |sed "s/.*<-> *\(.*\))/\1/"`
url=`echo "http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dpopular&field-keywords=$artist $album" |sed "s/ /+/g"`
curl -s -A "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6" "$url" |grep -m 1 "Product Details" |sed "s/.*img *src=\"\(http:\/\/[^\"]*\).*/\1/" |xargs curl -s -o /tmp/coverart.jpg
osascript -e 'tell application "GeekTool" to refresh (every image geeklet whose name contains "spotify")'
fi
else
osascript -e 'tell application "GeekTool" to set the width of (every image geeklet whose name contains "spotify") to 0'
rm /tmp/lastsong
fi
Denna är låtnamn
echo `cat /var/log/system.log |grep Spotify |sed "s/.*Spotify: //" |sed "s/ - Priority [0-9]//" |sed "s/://" |sed "s/\\\\\\n/ - /" |sed "s/$/?#\!#?/"` |sed "s/?#\!#?$//" |sed "s/.*?#\!#? //" |sed "s/ ([^(]*$//"
denna för artist - album
echo `cat /var/log/system.log |grep Spotify |sed "s/.*Spotify: //" |sed "s/ - Priority [0-9]//" |sed "s/://" |sed "s/\\\\\\n/ - /" |sed "s/$/?#\!#?/"` |sed "s/?#\!#?$//" |sed "s/.*?#\!#? .*(//" |sed "s/)$//"
Du måste ha Growl för att det ska fungera.
Frågor om scripten och frågor om det inte fungerar ->
https://www.flashback.org/t838888
Tack för hjälpen. Mycket tacksam