LastFM auto-refresher

By rhapsody Last update Aug 17, 2010 — Installed 1,438 times.


Script Summary: AJAX auto-Refreshes recent tracks, shouts, and artists on the user page for Last.fm without a full page refresh

Version: 1.06

Thumb Thumb

This is a fairly simple script that draws an "Auto Refresh" section above the player in the right column that allows you to toggle refreshing on and off. The left column with all of the Recently Listened to tracks, top artists, shouts, etc. is loaded in the background once every few minutes without requiring a page refresh.

The script calls in jQuery through a require statement so that it is only downloaded once. I'm sure I could have done the same thing without jQuery, but this was just an easy and quick convenience script mostly just written for myself.

Updated 7/24/2010. Added the ability to set your refresh timing. Also save both the timing and the "on" or "off" state so that it will persist after the page has been refreshed. Also made it look a little more "LastFM" with appropriately themed buttons and borders for everything.

Updated 7/25/2010. Added comments, cleaned things up a bit I did yesterday and added the shouts to the areas that were auto refreshed. ATM the two things that don't refresh on the front page are "Top Tracks" and "Top Artists"

Updated 8/17/2010. I made a couple of mistakes previously where I wasn't setting a value on confirm so when you went back or refreshed the page my settings panel didn't remember your previous choice. I've corrected this. Also realized I was prepending this whole panel to an element not everyone has on their user page (the about me section) and corrected this by adding it the right column instead. Sorry!