Search my Blog

Tags

Browse Past Posts

Browse by Topic

♥ Special ♥

Blogroll

Frequently Visited Sites

News, Geek & Security

www.flickr.com
This is a Flickr badge showing public photos and videos from Bruce Westbrook. Make your own badge here.

My Hosting Provider

My most excellent hosting provider since 2002...9 years and counting!

This is not the image you are looking for.


My First WordPress Plugin – Kind Of

Well, not really my own plugin from scratch.  I finally found a pretty good and relatively recent plugin to show my recently played songs.  By creating a profile at Last.fm and linking to my iTunes, songs I listen to on both my main home computer and my iPod (when it syncs) update my Last.fm profile.  The plugin I found then pulls the last X number of songs from my profile and displays it in the sidebar.

Of all the song plugins I played with over several days, this was the best of the bunch.  But it still had things I felt were missing or needed to be changed.

So for the past few days during some downtime at home I’ve been re-learning PHP and getting up to date with XML parsing, along with trying to intrepret someone else’s code.  For the most part this particular author took care to remark his code pretty well so it made it easier then most other authors I’ve come across.

The plugin I modded was Justin Turner’s “Last.fm Recently Played Tracks“.  Here’s a list of what I did:

  • Get larger profile picture for clearer image
  • Get larger album art for clearer image
  • Removed separate “view my profile” link
  • Added profile link via username and picture
  • Modifed user information syntax
  • Modified spacing within the “theTracks” user info panel
  • Added hyperlinks for artist, song and album
  • Added a CD jewel case around the album image (will mod this later with an actual image rather then borders, but good enough right now)
  • Get “generic” artist image if no album art exists or return a default album image if no artist image exists either

Most of it wasn’t all that difficult, just modifying HTML within the plugin.  The last one that took more then half my time was getting a generic artist image if the album image didn’t exist.  I found that an earlier version of Last.fm API actually had an artist image in the returned XML when looking for similar artists.  For some reason the version 2.0 doesn’t have that information.  Once I found that I got to learn all about parsing XML.  Fun stuff!

You can see the fruits of my labor on the right sidebar.  Nice, huh?

Per the license agreement, GNU General Public License v2, I am posting my modded version here.  I will also be contacting the original author, Justin Turner, to see if he wants my mods to possibly include into his version.  Sadly, it looks like his own website content went bye-bye recently, but maybe this will cheer him up some.

:-)

Next up, I may try my hand at a complete plugin and see what I can do.  Something simple to start with, but it will include a widget.  Not sure what yet, but stay tuned.

—————-
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

Leave a Reply

FireStats icon Powered by FireStats