Hi I'm writing a perl script which would import the last.fm counts to Erland's Trackstats plugin's tables. It would compare weekly playcounts and increase the Trackstats counts based on this. This should allow for a way to get plays form any Last.fm compatible player into the trackstats. I.e. iTunes, WMP, ipod etc.
I'm a novice (perl) writer and decided it would be too difficult (for me) to integrate as a plugin. It's freestanding script which accesses the mysql database directly, adds some tables and update them. It also fetches global / country wide playcounts for the tracks in your library. This allows you to create dynamic playlists like "play me music from my library that is popular on last.fm in South Africa". Or "play me music from my library that was popular in the last week on last.fm" etc. I'm already listening to dynamic playlists like the above using the sqlplaylist/dynamicplaylist plugin. However I have some utf8 issues (which I have no idea how to resolve). And I still need to write the bit that compares what is in trackstat versus what is in last.fm and updates. This script could be useful to someone who wants to a) run it once off and get all their last.fm playcounts into their library when they are starting out using trackstat (sort of backfill their data) b) run it regularly to get updated last.fm playcounts into their library c) run it regularly to get total playcount stats from last.fm (weekly and overall stats). d) run it regularly to get country wise playcount stats from last.fm (weekly stats). e) run it regularly to get group wise playcount stats from last.fm (weekly stats). (b)-(d) is sort of working except that tracks\artists with special characters in their names don't get the counts imported. I'm doing (a) next. (e) should be relatively easy to add once a and d are working although I won't use it. I need some pointers: 1) The tables I create seem to survive rescans. Do they survive squeezecentre upgrades? Only needed to keep the weekly history of (c)-(e). 2) I get the artist/track name (blob value) from the contributors/tracks table then query last.fm using their api using this to get the data. How do I ensure that I don't get into utf8 problems? At the moment I pass it unadjusted to the the "get" that fetches the last.fm data via xml (other than url escaping it). 3) This would seem to be a useful add-on to custom scan, but want to get it working standalone first. Regards Louis -- lrossouw 'Last.fm' (http://www.last.fm/user/lrossouw) ------------------------------------------------------------------------ lrossouw's Profile: http://forums.slimdevices.com/member.php?userid=3416 View this thread: http://forums.slimdevices.com/showthread.php?t=66987 _______________________________________________ plugins mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/plugins
