Avide85 Inviato 31 Agosto 2011 Segnala Condividi Inviato 31 Agosto 2011 so gia che ci sono alcune discussioni che spiegano ma qualche anima pia che mi dica lo scritp per vedere le canzoni di itunes con album e magari anche l'immagine passo passo Link al commento Condividi su altri siti Altre opzioni di condivisione...
MacLorenz Inviato 31 Agosto 2011 Segnala Condividi Inviato 31 Agosto 2011 Testo canzone #!/bin/sh export LC_ALL=C # Use 2 global variables SAV_TRACK_PATH=/tmp/savetrack.temp SAV_TRACK=$(cat $SAV_TRACK_PATH 2> /dev/null) RESULT= TRACK_INFO= export RESULT # No luck with the following services: # lyricstime: limits the # of requests for IP address # metrolyrics, mp3lyrics.org: lyrics not visible (seems to use placeholders) absolutelyrics() { set -- `echo $TRACK_INFO | sed 's/\ /_/g' | awk -F';' '{ print $1} {print $2 }'` ARTIST=$1 TRACK=$(echo $2 | sed 's/(.*)//g' | sed 's/\[.*\]//g') MYURL=$(echo http://www.absolutelyrics.com/lyrics/view/$ARTIST/$TRACK/ | sed 's/\?//g' | sed s/\'//g | tr '[:upper:]' '[:lower:]' | sed 's/\+//g' | sed 's/\,//g' | sed 's/\ /_/g') curl -s $MYURL > /tmp/ablyrics_tmp.lyr grep realText /tmp/ablyrics_tmp.lyr > /tmp/ablyrics_tmp2.lyr while read RESULT do break done < /tmp/ablyrics_tmp2.lyr RESULT=$(echo $RESULT | sed 's/<br\ \/>/^/g' | sed 's/<\/p>/^^/g' | sed '/^$/!{s/<[^>]*>//g;}' | tr '\^' '\n') return } azlyrics() { set -- `echo $TRACK_INFO | sed 's/\ //g' | awk -F';' '{ print $1} {print $2 }'` ARTIST=$(echo $1 | sed 's/the//g' | sed 's/The//g') TRACK=$(echo $2 | sed 's/(.*)//g' | sed 's/\[.*\]//g') MYURL=$(echo http://www.azlyrics.com/lyrics/$ARTIST/$TRACK.html | sed 's/\?//g' | sed s/\'//g | tr '[:upper:]' '[:lower:]' | sed 's/\+//g' | sed 's/\,//g' | sed 's/\ //g') RESULT=$(curl -s $MYURL | sed '1,/END OF RINGTONE/d' | sed '/\[ <a href/,9999d' | sed '/<br><br><br><br>/,9999d' | sed 's/<b>//g' | sed 's/<\/b>//g' | sed 's/<i>//g' | sed 's/<\/i>//g' | sed 's/<br>//g' | sed 's/<br \/>//g' | sed 's/<b>//g' | sed 's/<\/b>//g' | sed '3,4d') return } lyrics007() { set -- `echo $TRACK_INFO| sed 's/\ /%20/g' | sed 's/\[.*\]//g' | awk -F';' '{ print $1} {print $2 }'` MYURL=$(echo "http://www.lyrics007.com/$ARTIST%20Lyrics/$2%20Lyrics.html") # | sed 's/\?//g' | sed s/\'//g | sed 's/\+//g' | sed 's/\&//g') RESULT=$(curl -s $MYURL) if [[ "$RESULT" == *tf_artist* ]]; then # it's been found true else RESULT="" return fi RESULT=$(echo $RESULT | sed '1,/<br><br><br>/d' | sed '1,1d' | sed '/<br><br><script/,9999d' | sed 's/<br><br><br>//g' | sed 's/<\/script>//g' | sed 's/<BR>//g' | sed s/<br>/\^/g | tr '\^' '\n' | sed 's/<br>//g' | sed 's/<br \/>//g') if [ "$RESULT" = "" ]; then ARTIST=$(echo $1 | sed 's/the\%20//g' | sed 's/The\%20//g') MYURL=$(echo "http://www.lyrics007.com/$ARTIST%20Lyrics/$2%20Lyrics.html" | sed 's/\?//g' | sed s/\'//g | sed 's/\+//g' | sed 's/\&//g') RESULT=$(curl -s $MYURL | sed '1,/<br><br><br>/d' | sed '1,1d' | sed '/<br><br><script/,9999d' | sed 's/<br><br><br>//g' | sed 's/<\/script>//g' | sed 's/<BR>//g' | sed 's/<br>//g' | sed 's/<br \/>//g' | perl -i~ -pe 's/\x92/ /g') fi return } update_lyrics() { # Update lyrics on iTunes osascript -e ' tell application "iTunes" set lyrics of current track to system attribute "RESULT" end tell' } # MAIN LOGIC # Use an embedded AppleScript to get the iTunes information if ps x | grep iTunes | grep -v grep | grep -v -q iTunesHelper; then TRACK_INFO=$(osascript -e 'tell application "iTunes" if player state is playing then set trackname to name of current track set artistname to artist of current track set mylyrics to lyrics of current track set output to artistname & ";" & trackname & "^" & mylyrics end if end tell' | iconv -f utf-8 -t ucs-2-internal) # Don't fetch lyrics if already present in iTunes LYRICS=$(echo $TRACK_INFO | awk -F"^" '{print $2}') TRACK_INFO=$(echo $TRACK_INFO | awk -F"^" '{print $1}') if [ "$LYRICS" != "" ]; then echo $LYRICS exit 0 fi if [ "$TRACK_INFO" = "" ]; then # iTunes running but not playing exit 0 fi # 1. azlyrics.com azlyrics if [ "$RESULT" != "" ] && [ "$RESULT" != "0" ]; then RESULT=$(echo "$RESULT") update_lyrics echo "$RESULT" exit 0 fi # 2. lyrics007.com lyrics007 if [ "$RESULT" != "" ] && [ "$RESULT" != "0" ]; then RESULT=$(echo "$RESULT") update_lyrics echo "$RESULT" exit 0 fi # 3. absolutelyrics.com absolutelyrics if [ "$RESULT" != "" ] && [ "$RESULT" != "0" ]; then update_lyrics echo "$RESULT" exit 0 fi # GROWL notification if lyrics are not found if [ "$TRACK_INFO" != "$SAV_TRACK" ]; then PARSED_INFO=$(echo $TRACK_INFO | awk -F";" '{print $1; print $2}') /usr/local/bin/growlnotify --name "Geek Lyrics" -m "$PARSED_INFO" 'Lyrics not found' -I "/Users/thomas/Scripts/Add To iTunes.app" echo $TRACK_INFO > $SAV_TRACK_PATH fi fi titolo-album/%/stelle #!/bin/sh if ps x | grep iTunes | grep -q -v grep; then osascript -e 'tell application "iTunes" set trackname to name of current track set artistname to artist of current track set albumname to album of current track if albumname is null then set albumshow to " " else if albumname is "" then set albumshow to " " else set albumshow to " ( " & albumname & " ) " end if set trackduration to duration of current track set trackposition to player position set elapsed to round (trackposition / trackduration * 100) set myRating to round ((rating of current track) / 20) if myRating is 1 then set myRating to "| * " else if myRating is 2 then set myRating to "| ** " else if myRating is 3 then set myRating to "| *** " else if myRating is 4 then set myRating to "| **** " else if myRating is 5 then set myRating to "| ***** " else set myRating to "" end if set myRating to myRating set output to "" & trackname & " - " & artistname & albumshow & myRating & "| " & elapsed & "%" end tell' | iconv -f utf-8 -t ucs-2-internal fi l'immagine con geektool non si può Link al commento Condividi su altri siti Altre opzioni di condivisione...
Avide85 Inviato 31 Agosto 2011 Autore Segnala Condividi Inviato 31 Agosto 2011 scusami se ti rompo ma questi codici li devo mettere in una shell?? Link al commento Condividi su altri siti Altre opzioni di condivisione...
Avide85 Inviato 31 Agosto 2011 Autore Segnala Condividi Inviato 31 Agosto 2011 scusami doppio post operazione riuscita mi aspettavo qualcosa di piu tipo testo scorrevole Link al commento Condividi su altri siti Altre opzioni di condivisione...
Avide85 Inviato 31 Agosto 2011 Autore Segnala Condividi Inviato 31 Agosto 2011 piuttosto posso mettere una scritta mia qualsiasi? presa da un documento o anche scritta da me direttamente sul programma?? Link al commento Condividi su altri siti Altre opzioni di condivisione...
MacLorenz Inviato 31 Agosto 2011 Segnala Condividi Inviato 31 Agosto 2011 ti rimando qui dove trovi un po' di script Link al commento Condividi su altri siti Altre opzioni di condivisione...
teo90 Inviato 25 Novembre 2011 Segnala Condividi Inviato 25 Novembre 2011 ciao! c'e' la possibilita' di avere i minuti e i secondi al posto che la percentuale?? grazie MacBook Pro 2011 iPhone 4s 16Gb Link al commento Condividi su altri siti Altre opzioni di condivisione...
MacLorenz Inviato 25 Novembre 2011 Segnala Condividi Inviato 25 Novembre 2011 c'è questo Link al commento Condividi su altri siti Altre opzioni di condivisione...
teo90 Inviato 25 Novembre 2011 Segnala Condividi Inviato 25 Novembre 2011 non so esattamente come fare...mi sai dire passo passo come fare per mettere le info del brano? MacBook Pro 2011 iPhone 4s 16Gb Link al commento Condividi su altri siti Altre opzioni di condivisione...
Glz Inviato 25 Novembre 2011 Segnala Condividi Inviato 25 Novembre 2011 apri geektool trascini una nuova finestra shell sul desktop e nella barra grigia scura che si aprirà c è lo spazio commando dove inserirai il comando facendo copia-incolla Link al commento Condividi su altri siti Altre opzioni di condivisione...
teo90 Inviato 26 Novembre 2011 Segnala Condividi Inviato 26 Novembre 2011 sisi quello che c'e' qui funziona...ma da' problemi...itunes si riapre automaticamente all'infinito... mentre quello di MacLorenz non capisco esattamente come usarlo MacBook Pro 2011 iPhone 4s 16Gb Link al commento Condividi su altri siti Altre opzioni di condivisione...
Glz Inviato 26 Novembre 2011 Segnala Condividi Inviato 26 Novembre 2011 sisi quello che c'e' qui funziona...ma da' problemi...itunes si riapre automaticamente all'infinito... mentre quello di MacLorenz non capisco esattamente come usarlo Si scarica e aprendolo si configura e avvia da solo Link al commento Condividi su altri siti Altre opzioni di condivisione...
teo90 Inviato 27 Novembre 2011 Segnala Condividi Inviato 27 Novembre 2011 ad essere sincero...sara' che non sono capace io ma non riesco a farlo funzionare MacBook Pro 2011 iPhone 4s 16Gb Link al commento Condividi su altri siti Altre opzioni di condivisione...
teo90 Inviato 28 Novembre 2011 Segnala Condividi Inviato 28 Novembre 2011 Up MacBook Pro 2011 iPhone 4s 16Gb Link al commento Condividi su altri siti Altre opzioni di condivisione...
OrsoBubu Inviato 30 Dicembre 2011 Segnala Condividi Inviato 30 Dicembre 2011 Testo canzone #!/bin/sh export LC_ALL=C # Use 2 global variables SAV_TRACK_PATH=/tmp/savetrack.temp SAV_TRACK=$(cat $SAV_TRACK_PATH 2> /dev/null) RESULT= TRACK_INFO= export RESULT # No luck with the following services: # lyricstime: limits the # of requests for IP address # metrolyrics, mp3lyrics.org: lyrics not visible (seems to use placeholders) absolutelyrics() { set -- `echo $TRACK_INFO | sed 's/\ /_/g' | awk -F';' '{ print $1} {print $2 }'` ARTIST=$1 TRACK=$(echo $2 | sed 's/(.*)//g' | sed 's/\[.*\]//g') MYURL=$(echo http://www.absolutelyrics.com/lyrics/view/$ARTIST/$TRACK/ | sed 's/\?//g' | sed s/\'//g | tr '[:upper:]' '[:lower:]' | sed 's/\+//g' | sed 's/\,//g' | sed 's/\ /_/g') curl -s $MYURL > /tmp/ablyrics_tmp.lyr grep realText /tmp/ablyrics_tmp.lyr > /tmp/ablyrics_tmp2.lyr while read RESULT do break done < /tmp/ablyrics_tmp2.lyr RESULT=$(echo $RESULT | sed 's/<br\ \/>/^/g' | sed 's/<\/p>/^^/g' | sed '/^$/!{s/<[^>]*>//g;}' | tr '\^' '\n') return } azlyrics() { set -- `echo $TRACK_INFO | sed 's/\ //g' | awk -F';' '{ print $1} {print $2 }'` ARTIST=$(echo $1 | sed 's/the//g' | sed 's/The//g') TRACK=$(echo $2 | sed 's/(.*)//g' | sed 's/\[.*\]//g') MYURL=$(echo http://www.azlyrics.com/lyrics/$ARTIST/$TRACK.html | sed 's/\?//g' | sed s/\'//g | tr '[:upper:]' '[:lower:]' | sed 's/\+//g' | sed 's/\,//g' | sed 's/\ //g') RESULT=$(curl -s $MYURL | sed '1,/END OF RINGTONE/d' | sed '/\[ <a href/,9999d' | sed '/<br><br><br><br>/,9999d' | sed 's/<b>//g' | sed 's/<\/b>//g' | sed 's/<i>//g' | sed 's/<\/i>//g' | sed 's/<br>//g' | sed 's/<br \/>//g' | sed 's/<b>//g' | sed 's/<\/b>//g' | sed '3,4d') return } lyrics007() { set -- `echo $TRACK_INFO| sed 's/\ /%20/g' | sed 's/\[.*\]//g' | awk -F';' '{ print $1} {print $2 }'` MYURL=$(echo "http://www.lyrics007.com/$ARTIST%20Lyrics/$2%20Lyrics.html") # | sed 's/\?//g' | sed s/\'//g | sed 's/\+//g' | sed 's/\&//g') RESULT=$(curl -s $MYURL) if [[ "$RESULT" == *tf_artist* ]]; then # it's been found true else RESULT="" return fi RESULT=$(echo $RESULT | sed '1,/<br><br><br>/d' | sed '1,1d' | sed '/<br><br><script/,9999d' | sed 's/<br><br><br>//g' | sed 's/<\/script>//g' | sed 's/<BR>//g' | sed s/<br>/\^/g | tr '\^' '\n' | sed 's/<br>//g' | sed 's/<br \/>//g') if [ "$RESULT" = "" ]; then ARTIST=$(echo $1 | sed 's/the\%20//g' | sed 's/The\%20//g') MYURL=$(echo "http://www.lyrics007.com/$ARTIST%20Lyrics/$2%20Lyrics.html" | sed 's/\?//g' | sed s/\'//g | sed 's/\+//g' | sed 's/\&//g') RESULT=$(curl -s $MYURL | sed '1,/<br><br><br>/d' | sed '1,1d' | sed '/<br><br><script/,9999d' | sed 's/<br><br><br>//g' | sed 's/<\/script>//g' | sed 's/<BR>//g' | sed 's/<br>//g' | sed 's/<br \/>//g' | perl -i~ -pe 's/\x92/ /g') fi return } update_lyrics() { # Update lyrics on iTunes osascript -e ' tell application "iTunes" set lyrics of current track to system attribute "RESULT" end tell' } # MAIN LOGIC # Use an embedded AppleScript to get the iTunes information if ps x | grep iTunes | grep -v grep | grep -v -q iTunesHelper; then TRACK_INFO=$(osascript -e 'tell application "iTunes" if player state is playing then set trackname to name of current track set artistname to artist of current track set mylyrics to lyrics of current track set output to artistname & ";" & trackname & "^" & mylyrics end if end tell' | iconv -f utf-8 -t ucs-2-internal) # Don't fetch lyrics if already present in iTunes LYRICS=$(echo $TRACK_INFO | awk -F"^" '{print $2}') TRACK_INFO=$(echo $TRACK_INFO | awk -F"^" '{print $1}') if [ "$LYRICS" != "" ]; then echo $LYRICS exit 0 fi if [ "$TRACK_INFO" = "" ]; then # iTunes running but not playing exit 0 fi # 1. azlyrics.com azlyrics if [ "$RESULT" != "" ] && [ "$RESULT" != "0" ]; then RESULT=$(echo "$RESULT") update_lyrics echo "$RESULT" exit 0 fi # 2. lyrics007.com lyrics007 if [ "$RESULT" != "" ] && [ "$RESULT" != "0" ]; then RESULT=$(echo "$RESULT") update_lyrics echo "$RESULT" exit 0 fi # 3. absolutelyrics.com absolutelyrics if [ "$RESULT" != "" ] && [ "$RESULT" != "0" ]; then update_lyrics echo "$RESULT" exit 0 fi # GROWL notification if lyrics are not found if [ "$TRACK_INFO" != "$SAV_TRACK" ]; then PARSED_INFO=$(echo $TRACK_INFO | awk -F";" '{print $1; print $2}') /usr/local/bin/growlnotify --name "Geek Lyrics" -m "$PARSED_INFO" 'Lyrics not found' -I "/Users/thomas/Scripts/Add To iTunes.app" echo $TRACK_INFO > $SAV_TRACK_PATH fi fi l'immagine con geektool non si può Ciao MacLorenz, ho provato a mettere lo script in geektool e settare il refresh a 1 ma quando avvio una canzone da iTunes non si vede niente. Sbaglio qualcosa? Grazie. Alessio Forconi Photography Link al commento Condividi su altri siti Altre opzioni di condivisione...
MacLorenz Inviato 6 Gennaio 2012 Segnala Condividi Inviato 6 Gennaio 2012 ciao, ti ho risposto anche di la'.. cmq lo script funziona se i tuoi file mp3 nei tag hanno le lyrics, in teoria se non ce li hanno la cerca su quei 3 siti ma io tenevo aperto in dashboard tunestext che funziona meglio l'ho appena riprovato e funziona, refresh 1sec. prova a fare partire una canzone che ha la lyrics nei tag (per controllare fai mela-i sulla canzone in itunes). dovrebbe andare Link al commento Condividi su altri siti Altre opzioni di condivisione...
liukke Inviato 24 Giugno 2013 Segnala Condividi Inviato 24 Giugno 2013 Ciao a tutti...qualcuno sa se è possibile far comparire i widget di geektool solo su un desktop di Spaces????? Ad esempio se io ho 4 desktops di Spaces so che posso mettere su ogni desktop uno sfondo diverso, se volessi far comparire geektool solo sul primo desktop e non su gli altri 3!!!! Grazie Link al commento Condividi su altri siti Altre opzioni di condivisione...
Messaggi raccomandati
Archiviato
Questa discussione è archiviata e chiusa a future risposte.