A pretty sweet wallpaper, if you ask me |
As you've probably gathered by now, I listen to music basically whenever I can. I keep track of my listening statistics using a fantastic service called Last.fm. This benefits me in multiple ways - they're able to suggest me new tracks based on the type of songs that listen to (albeit the algorithm isn't as good as the one Spotify uses), and I can see how my music taste shifts over time. Statistics interest me, so the weekly report is a fantastic method of visualising my listening habits. I tend to listen to a large number of tracks over the course of a week.
Another great thing about Last.fm is the number of 3rd party applications available. The API allows these services to access your listening data and provide all kinds of cool stats & visualisations. There's a great post over at /r/lastfm with list of all the currently working websites.
One of my favourites is lastfm.dontdrinkandroot.net which creates a word cloud of your top artists. Here's mine:
I was also browsing build.last.fm, an older part of the site that hasn't yet been updated with the modern design, and found a python script that created a wallpaper from your listening stats. I had already installed a Live Wallpaper that does the same thing on my phone, so it made sense to try out the script for my Mac. Unfortunately, it was written for Python 2 and required a Python Imaging library (PIL) that no longer exists, or at least I couldn't get it working. Luckily, I found an updated version of the script on GitHub that functioned, even though it was last updated 4 years ago.
alecksphillips/wallpaperfm
This was much easier to setup and run. This is what you need to do:
Clone the repository
Head to https://github.com/alecksphillips/wallpaperfm and download a zipped copy of the repository. Extract it's contents to a folder and open a new terminal tab at this folder.
Install dependencies
Make sure you have python3 installed and in your PATH file - type python and then hit tab to see a list of the possible commands. If python3 isn't an option, I'd recommend using Brew to install it. Type in
brew install python3
once it's installed. You should now be able to type python3 --version
in Terminal and get the following (or similar) output.
You should also have
pip
working.
From here, to install all the required dependencies, type
pip3 install -r requirements.txt
to install Pillow.Run the script
You should get some output when you type
python3 wallpaperfm.py -h
that looks like the following:
This is simply explaining what you can do with the script. Have a look through all the options and try and create something unique for yourself. To generate a wallpaper like mine, run the command:
python3 wallpaperfm.py -u danster103 -i 2560x1600 -m collage -C \#212121 -T jpg -c 2750x1800 -n 150
(and obviously replace danster103 with your last.fm username)
It'll download all the images, cache them to reduce server load, and then create the awesome wallpaper.
That's all for this blog post, if you do end up creating a wallpaper using the script let me know by leaving a comment or tweet me @danstoneyuk
Oh, and notice that widget in the sidebar? That's an RSS feed powered by xiffy.nl.
Comments
Post a Comment