Tech Meets Tunes: Creating a Seamless Alfred Workflow for EDM Aficionados
Tags: alfred, digitallyimported, workflow
Published: 2024-01-05 18:54:46

---
title: "Tech Meets Tunes: Creating a Seamless Alfred Workflow for EDM Aficionados"
published: true
description: 
tags: alfred,digitallyimported,workflow
cover_image: https://www.alfredapp.com/media/logo4@2x.png
---

### The Problem

If you're a EDM fan like me you probably know the super traditional website [Digitally Imported](https://di.fm).

I'm a long time supporter (and I recommend you consider supporting it - streaming bills ain't cheap ya know). But one thing bugged me for a long time: it has no native player like Spotify and Apple Music. And I like changing stations all day long. And I don't like keeping a browser tab exclusively for this.

Since I'm a heavy Alfred user I looked for a workflow but had no luck. So I made one.

### The Solution
The workflow editor is pretty neat. You drop boxes and link them in order to make one box's output become the other's input:

![My Alfred's Workflow panel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h6d9yvzfkbk3losdov9.png)
*My Alfred's Workflow panel*

And that's it. Just two boxes linked in order to play some electronic music ❤️ 

### But wait, there's more!
It would be a very boring article if it ended here, right? 😊 
First of all, the list of radio stations is huge! (99):

![double clicking on List Filter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nb20ohcdidm57m9b5xzu.png)
*double clicking on List Filter*

I would never type 99 times each station information... No... I asked our friendly overlord **GPT-4** for some help.

### Chat GPT to the rescue
All I had was the 99 url slugs for each radio station. When you open a playlist (.pls file) you'll get all the streaming url's in the form:

`http://prem1.di.fm/${query}?XXXXXX`

Where `${query}` is the station name and `XXXX` is your 'Listen key' that can be grabbed on the [Settings](https://www.di.fm/settings) page.

But in order to fill the workflow's *List Filter* I needed a .csv file with 3 columns:
1. First some words, separated by space, which are searched after you type your workflow's keyword
2. A plain text english description that will be shown as a subtitle
3. The value that will be passed as the input for the next node on the graph

So the prompt I wrote was basically:

```markdown
Given the following slugs:

- 00sclubhits
- ambient
- atmosphericbreaks
... (until 99)

Create a three column CSV formatted list of:

- the slug broken in words
- a plain english description of the slug
- the slug unchanged
 
For example:

- 00sclubhits

in CSV:

00s club hits, 2000's Club Hits, 00sclubhits
```

And it very kindly generated [this csv file](https://gist.github.com/moniquelive/bee80daafd5fb6658e8f3baa5419df57). ❤️ (full disclosure: I removed the header line and removed extra spaces between columns that confused Alfred)

Then I dragged the generated .csv file into the left column of the *List Filter* and that was it for this node.

The second node is super simple. It's a *Run Script* node with the following:

![Open Apple Music with the following url](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mf69tbqw5z6ryuzqfnqf.png)
*Open Apple Music with the following url*

You can use your preferred player here. I tested with VLC and Apple Music.

### And that's it!

Now you have a personalized station picker:

![All the vocal stations](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7pg24q1bwwiihjzbz0q0.png)
*All the vocal stations*

I hope you enjoyed reading this as much as I enjoyed putting this together.

Have a good one!