Last Listened generates an image with the last songs a user has listened to. It is extensible via plugins to support a variety of services, however, currently, only Last.fm is supported. More plugins will be added if I have time, or if any are user-contributed.
-
The image size, font faces, colors, and background colors are all customizeable.
-
The export file name is customizeable.
-
The file can be sent to an SFTP server for updating on a website. For an example, see my website.
-
Where the last played songs are pulled from can be customized via plugins written in python (see below).
-
If you have pngcrush installed, it can be used to automatically compress the generated image.
The below image is an example export from Last Listened.
A number of default settings are pre-set in the config_template file however none of the credentials are set. These will need to be filled out as well as any color, font, and image dimension settings changes if you don't like the defaults.
Once the changes have been made, the file should be renamed to .config and placed in the same folder as the program.
Plugins allow last played songs to be pulled from a variety of services, or even local databases. To create and use a different plugin, please note the following:
-
All plugins should be in the plugins sub-folder.
-
An entry will need to be created under "plugins" for the new plugin and any appopriate configuration values should be added to it. Note: this entry should be named the same as the plugin file without the .py extension.
-
The "plugin" entry in the .config will need to be changed to the name of the new plugin.
That should be all there is to it.
-
All plugins should be written in Python.
-
Plugins should have a class named TrackPlugin.
-
This class should have a constructor that accepts the plugin data structure from the .config file as an argument.
-
This class should have a public method named get_tracks that returns a list of dictionaries containing the following elements:
- artist: The artist name
- track: The track name
- when: How long ago the track was listened to
- cover: The url of the album cover
If you write a plugin and would like to contribute it, please let me know.
© 2023 Carson F. Ball
If you like this project and want to see more projects from me, please contribute if you are able.
3QzgUdXzbLY7oy15XeMJ4W37cfBJDeKj6A
Webull affiliate link: https://a.webull.com/8XVE5sOKtu1sPAStxw
Robinhood affiliate link: join.robinhood.com/carsonb453
Creative commons Attribution-NonCommercial (CC BY-NC)
You can share this code (including your own modifications) as long as the following conditions are met. Please see the links below for more information.
-
You state somewehere in the program credits (and documentation if applicable) that Carson F. Ball is the original author and list the location that the original can be downloaded.
-
You do not claim that Carson F. Ball endorses or approved of any modifications that you make and you clearly indicate that you have made modifications.
-
You do not release this code commercially.
Plain text of the license
Full legalese of the license