Remove ads, unlock a dark mode theme, and get other perks by upgrading your account. Experience the website the way it's meant to be.

A Simple Streaming Music Sharing Page for Chorus

Discussion in 'Article Discussion' started by Melody Bot, Jul 1, 2019.

  1. Melody Bot

    Your friendly little forum bot. Staff Member

    This article has been imported from for discussion. All of the forum rules still apply.

    The music streaming service revolution has been one of the biggest, and most exciting, developments to the music and technology world in my lifetime. We went from driving to a store to buy music, often without ever hearing it beforehand, to having countless hours of music in our pockets with virtually no limits to what we could discover and listen to with the mere press of a button.

    As someone that runs a music website, and now a weekly newsletter, that often includes recommendations about new music, I’ve long struggled with just how to share those recommendations with the most people. On this website, I often link to the YouTube video in the post itself for instant listening and then will link to Apple Music and Spotify when appropriate (or if the song isn’t on YouTube yet) since those are the two biggest streaming platforms. I like those short URLS that a lot of labels and PR people are using these days that aggregate all of the streaming platforms into one place for easy sharing; however, what I really wanted was something that I had a little more control over. What if I use a service like this and then it goes under, and all my links die? All of a sudden hours of meticulously linking music recommendations on this website or my newsletter could end up having dead links. So, after coming across the excellent Song.Link service and their API, I decided I would be best served in creating something for myself. That way I could easily create a place to share a song or album, and I wouldn’t have to worry about the URL going away in a few years or it not being updated as streaming services come and go.

    The end result is a page that includes links to all the big streaming services, as well as a YouTube video for quick streaming if it exists, and links to purchase the music as well. For example:

    It’s not unlike the other sharing services out there, but it’s built to load extremely fast, not be filled with extra junk, and be a simple landing page for songs and albums so someone can get to the part of hearing the music as quickly as possible. I built it for myself because I want something like this to use here on the website, and in my newsletter, that I can control and tweak as needed. I’ll start incorporating it into my posts and features more and more over the next few weeks as I test out the bugs and issues that may arise. It technically is open for anyone else to use it if they would like as well. The URL scheme is pretty standard: and there is a very basic search.

    At the request of a supporter, I also created a simple iOS Shortcut that can act as a way to get the share link for a song, or album, that you are currently playing via Apple Music. When it runs it’ll look at what you’re currently listening to and ask if you’d like to share the song or album, and then create the link for you and either put it on your clipboard or open up the share page. It works well as an extension:

    I also created two Alfred Workflows for myself and tossed those on Github.

    On the technical side, basically, the way this works is that the song or album has to be in Apple Music’s database, and if it is we use that information to pull everything from the other services using Song.Link’s backend. The first time we do this for any release, it may take a second to pull the information, but after that everything is stored in static files and should be extremely fast to load. Since I only made this for myself, I haven’t played around with a bunch of edge cases or anything like that quite yet, so it may be rough around the edges.1 But, I think it’s pretty neat, and I’m excited to be able to use it each week when writing about music. Oh, yeah, since I did all this basically for the newsletter … um, please sign up for it.

    1. If you do see any issue with any of the pages, feel free to reach out to me and let me know.

  2. bibout182


    I love what you made. Congrats!
    BoldType likes this.
  3. AMC


    I like this. Very well done.
    Jason Tate likes this.
  4. rixscix


    Man I work at a label and this is - to me - ground breaking, exactly what I was hoping for someone to invent.
  5. irthesteve

    formerly irthesteve Prestigious

    You should look into extending this look for digital movies as well, I don't think I have seen a service that does this for movies yet.

    Trailer at the top then links to Apple, Amazon, Vudu, Google Play, Xbox, Playstation
    bradsonemanband and Jason Tate like this.
  6. Yellowcard2006


    This is very cool, but I suppose it is reliant on sticking around for a while? Or is the code for their link aggregation system within the server?
  7. rxbandit89

    probably over-caffeinated.

    This is killer. Awesome job!
    Jason Tate likes this.
  8. Jason Tate Jul 1, 2019
    (Last edited: Jul 1, 2019)
    Not sure how much this means cause I'm about to use a few nerdy words, but basically, what they send back is a JSON response with information about all the links (a giant text array). I save and cache all of that information on my server (they're just text files), so no matter what every single link that I ever generate will always have that information sitting there in that text format and won't go anywhere.

    If went away I'd stop getting new responses for lookups, so I'd then have to write my own backend to do that heavy lifting. I'd just duplicate the format of spitting out the various links they use and start generating my own JSON files from the various service APIs and then I could simply plug that part into this script where it does the lookup, and it would continue working as is. It would take some time to write that code and figure out all the other service responses, but it's doable. I've thought about just writing that part now anyway just in case.
    BoldType and David Parke like this.
  9. IbanezRX


    Very interesting on song.links part. They’re basically a meta pulling data from all those singular APIs and just compiling their own template based pages from the data they’re pulling. I would think at that point they don’t even need to persist any of the data to their own database so long as they maintain all the paths in their controller module to make sure the APIs are current.

    I would doubt every single one of those content providers would go under anytime soon. Especially when it comes to YouTube. If you’re persisting all the JSON to your database, you should be alright for a good many years I’d say.
  10. rxbandit89

    probably over-caffeinated.

    I don’t know half of these terms so can can’t contribute much of anything here, but I do know that you should be calling the database where the JSON is stored the JSON TATE-abase.
  11. Ok that’s pretty funny.
    David Parke and rxbandit89 like this.
  12. Damien Davies

    take me over Supporter

    I fucking love this.
    Jason Tate likes this.
  13. RazorCrusade

    We make our own luck and we live with every defeat Supporter

    I love everything about this. Thank you, Jason!
    Jason Tate likes this.
  14. Yellowcard2006


    That's awesome that it would only effect future lookups should the service ever shutdown (which you'd have a heads-up on anyway). If it was a real time look-up through their API every time or actually stored local was basically my question. This is great!
  15. Dan O'Neill


    This is really handy. And hey, everyone go listen to that Mannequin Pussy album. It rules.
    JRGComedy and Jason Tate like this.
  16. CyberInferno

    Line below my username Supporter

    @Jason Tate I think you mean "" in the footer. As soon as I saw your page, I recognized it (I use that site all the time for posting links in forums). :-)
    "Created by Jason Tate. Powered by"
    Jason Tate likes this.
  17. alkalinexandy

    Trusted Supporter

    This is great (and will save me a few seconds every time I go to look up the suggested tracks at the end of the newsletter each week).
    Jason Tate likes this.
  18. RileyWitiw

    more like Supporter

    I really admire your dedication to making this a functional, top of the line website.
    Dan O'Neill and Jason Tate like this.
  19. Truth...I’ve been following along since about 2004 (on AP) and it’s really amazing how far Jason has come with the site.
  20. latortuga

    Regular Supporter

    As a developer, these nerdy words all make sense to me. I advise you to delete this post though, their API terms expressly prohibit what you're doing wrt saving responses. It's definitely what I would do as an API vendor so I went to check and sure enough.
  21. I read their agreement and talked to them before launching this and don’t see anything that says this or hear I couldn’t cache the response .. where did you see it?
  22. latortuga

    Regular Supporter

    The terms are here:

    Section 5e is what I was referring to, specifically the first bullet point.
  23. That’s regarding ripping and keeping the music, the actual content of the files, from the links.