Project: |
activate https |
Everything will be done in the local application directory. Under Linux this is '~/.local/share/Last.fm' and under MacOSX, this is '~/Library/Application Support/Last.fm'.
- When a new track is started, the file (in the app-dir as said) 'onNewEvent'
will be executed with the parameters 'newtrack: "$artist" - "$songname"'.
- When a track is over (no skipping or stop), the file 'onNewEvent' will be
executed with the parameters 'endtrack: "$artist" - "$songname"'. If the
return-code of the script is 0 (the default) then the track will be saved (in
this dir) as a MP3 "$artist - $songname.mp3". ID3V1-tags will also be included
into the file. If 'onNewEvent' is not available or not executable, the MP3 will
not be saved.
That means, the application only behaves different if you create an executable file called 'onNewEvent' in the local application directory. Then, if it is just an empty executable file, you will get all songs saved as MP3s (but only the songs you listen to till the end; songs you skip aren't saved). You can also use the script for example to set your message in your instant messanger or you can save a log with all played songs or something like this.
The source patch is available for version 1.3.1.0, 1.3.2.13 and 1.4.1.57486 of lastfmplayer.
I created also a patched MacOSX package. Download the Last.fm-1.6.1.1337.dmg. You can install it by simply opening the DMG and copying the Last.fm application to your applications directory.
Now, for an easy setup (to actually let Last.fm save your songs), open a Terminal (under Applications / Utilities) and type the following:
# download an easy onNewEvent script mkdir -p ~/"Library/Application Support/Last.fm" cd ~/"Library/Application Support/Last.fm" curl "http://www.az2000.de/projects/lastfm/onNewEvent-simple" > onNewEvent chmod +x onNewEvent # create a link in your Music directory cd ~/Music ln -s ~/"Library/Application Support/Last.fm" LastFM
Your Last.fm should be ready to save songs now. It will save all fully heard songs. You can browse all saved songs in your Music / LastFM directory. Don't touch the non-MP3 files there, they belong to Last.fm.
If you want to compile Last.fm by yourself on MacOSX (You don't need to do that. Do that only if you fully understand that.), you need to install the Xcode developer tools and the Qt4 SDK. Then do something like the following:
svn co svn://svn.audioscrobbler.net/clientside/Last.fm/tags/1.4.1.57486 lastfm curl "http://www.az2000.de/projects/lastfm/1.4.1.57486-added_saving_and_event_support.patch" > lastfm.patch curl "http://www.az2000.de/projects/lastfm/lastfm--build-release-osx.sh" > lastfm--build-release-osx.sh curl "http://www.az2000.de/projects/lastfm/lastfm--add-Qt-to-bundle.sh" > lastfm--add-Qt-to-bundle.sh curl "http://www.az2000.de/projects/lastfm/lastfm--deposx.sh" > lastfm--deposx.sh chmod +x lastfm--build-release-osx.sh chmod +x lastfm--add-Qt-to-bundle.sh chmod +x lastfm--deposx.sh cd lastfm patch -p1 --dry-run < ../lastfm-1.4.1.57486-added_saving_and_event_support.patch # if dry-run was ok, then do it: patch -p1 < ../lastfm-1.4.1.57486-added_saving_and_event_support.patch # now let's build everything: ../lastfm--build-release-osx.sh # if that was successfull, you have the Last.fm-1.6.1.1337.dmg in lastfm/dist/
If you want to support my work, please donate via Gittip/Flattr here:
The program published here is under the copyright of Albert Zeyer. In that case there is the source code to download, it is under the LGPL-licence. Distributions of it are only allowed with a reference to this page.
Links
- Other projects
- Mainsite
Albert Zeyer (Mail)
You are the 2247628th boy, who looks closely at this site.
"Doctor, that's not *my* shou" yelled the wanton home-coming queen as the rabid hired hand lashed her alabaster hooters and pushed his hole splitting poker into her moist furrow.
06:05:40 up 1305 days, 10:47, 10 users, load average: 2.46, 2.51, 2.52
The code can be seen here. Please contact me if you find any problems. :)