Skip to main content

David Mead

Listened to the soundtrack of The Taking Of Pelham One-Two-Three | Soundtrack Suite

By David Shire

Classic 70's sound.

David Mead

Listened to the soundtrack of Amélie

By Yann Tiersen

David Mead

David Mead

Changing a plugin for Known (coding) #indieweb

2 min read

I wanted to change up how a plugin worked on my blog. Namely the Listen one.

Out-of-the-box

Looking at it after install if allowed me to capture someting I had listened too. I could link to somewhere that'd let others here it, and put in "cover art" and some notes.  All fantastic.

screenshot of Listen post

Couple of things I wanted to change:

  • artist closer to the title, and not after my notes
  • icon indicating song, podcast, etc.
  • definition between my notes and what I had listened to

Breaking stuff

So I "forked the repo" and basically spent today pulling apart and putting back togther PHP code that I had no idea did what.

I found that the 'listen types' weren't being pulled through to assign an icon to, so I commented out a large section and replaced it with a simple <select> element.  This seems to have worked, though I don't know (yet) how to retain what I selected if I edit the post.

I've now got it looking a lot more how I wanted and it sees the listen type and shows the matching icon.

screenshot of new Listen posts

Also did some more changes while I was feeling brave:

  • I added a lot more types including soundtrack and audio book
  • Changed the titles to past tense
  • Updated the edit page by matching labels to fields, wrapping fields in <p>, and changed some of the language used there too

Going forward

I've posted on the IRC that I've made the changes, so I'll see if, and how, anyone wants to merge these into the plugin.

I'd love to get Last.FM and Huffduffer integrated so they post automagically.

 

David Mead

Listened to the soundtrack of Mute (2018) - Full soundtrack

By Clint Mansell

Thanks to @ManMadeMoon for linking to @iamclintmansell's score.  I really liked the film and this evokes that awkward and edgy future Berlin wonderfully.