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 184.108.40.206, 220.127.116.11 and 18.104.22.168486 of lastfmplayer.
I created also a patched MacOSX package. Download the Last.fm-22.214.171.1247.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/126.96.36.199486 lastfm curl "http://www.az2000.de/projects/lastfm/188.8.131.52486-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-184.108.40.206486-added_saving_and_event_support.patch # if dry-run was ok, then do it: patch -p1 < ../lastfm-220.127.116.11486-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-18.104.22.1687.dmg in lastfm/dist/
If you want to support my work, please donate via Gittip/Flattr here: Project: . Project by Albert Zeyer.
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.
- Other projects
Albert Zeyer (Mail) Homepage with many open source projects including source code, artworks, both images and music, pictures and some writings about technical stuff, tutorials and some stories.
You are the 1477879th thing, which was able to find this site.
"Not in public!" cried the friendly woman as the slurping ex-celibate fucked her oozing protuberances and slammed his glistening foot into her festering continental divide.
17:51:24 up 1150 days, 1:10, 1 user, load average: 0.23, 0.09, 0.07
The code can be seen here. Please contact me if you find any problems. :)