<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: niks17</title>
    <description>The latest articles on DEV Community by niks17 (@niks17).</description>
    <link>https://dev.to/niks17</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3983189%2F3639e27b-0776-4dc2-b08d-0e393ae9860a.png</url>
      <title>DEV Community: niks17</title>
      <link>https://dev.to/niks17</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/niks17"/>
    <language>en</language>
    <item>
      <title>I built an SEO-first internet radio site — and learned why `curl` can't validate audio streams</title>
      <dc:creator>niks17</dc:creator>
      <pubDate>Sat, 13 Jun 2026 21:18:46 +0000</pubDate>
      <link>https://dev.to/niks17/i-built-an-seo-first-internet-radio-site-and-learned-why-curl-cant-validate-audio-streams-2fpa</link>
      <guid>https://dev.to/niks17/i-built-an-seo-first-internet-radio-site-and-learned-why-curl-cant-validate-audio-streams-2fpa</guid>
      <description>&lt;p&gt;I recently built &lt;a href="https://radiobalkan.net/" rel="noopener noreferrer"&gt;Radio Balkan&lt;/a&gt; — a single-page web player that puts 750+ Balkan radio stations in one place: no ads, no sign-up, no cookie banners. It's my first "real" shipped project, and the journey taught me more than any tutorial. Here are the parts I think other devs will find useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack (deliberately boring)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One static HTML file&lt;/strong&gt; for the app — vanilla HTML/CSS/JS, no framework.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supabase&lt;/strong&gt; (Postgres + REST) as the station database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Netlify&lt;/strong&gt; for hosting + free SSL.&lt;/li&gt;
&lt;li&gt;A small &lt;strong&gt;Node script&lt;/strong&gt; that generates the SEO pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No build step, no SPA framework. The whole thing loads fast and is trivial to deploy (drag a folder onto Netlify).&lt;/p&gt;

&lt;h2&gt;
  
  
  SEO-first: the thing competitors get wrong
&lt;/h2&gt;

&lt;p&gt;Most existing radio sites are JavaScript SPAs. Open the page source and there's… nothing — the content is rendered client-side. Google &lt;em&gt;can&lt;/em&gt; execute JS, but it's slower and less reliable, and crucially: &lt;strong&gt;there are no crawlable per-station pages to rank.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So I went the other way. A Node script pulls every station from Supabase and generates &lt;strong&gt;500+ static HTML pages&lt;/strong&gt; — one per station, country and genre — plus &lt;code&gt;sitemap.xml&lt;/code&gt;. Each page is real HTML with the content right there.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// for each station -&amp;gt; write a static, crawlable page&lt;/span&gt;
&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`radio/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/index.html`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;stationPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;station&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Within days the site was indexed and getting its first organic clicks. Static pages beat a bigger-but-invisible catalog.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supabase + RLS: public, but safe
&lt;/h2&gt;

&lt;p&gt;The browser talks to Supabase directly with the anon key, which is fine &lt;strong&gt;if&lt;/strong&gt; Row Level Security is set up right:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;stations&lt;/code&gt; → public &lt;strong&gt;read only&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;submissions&lt;/code&gt; (user-suggested stations) → &lt;strong&gt;insert only&lt;/strong&gt;, no select policy, so nobody can read others' submissions.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;service_role&lt;/code&gt; key never ships to the client — it's only used locally for seeding.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Public anon key + correct RLS = a serverless backend with no backend code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lesson that cost me the most: &lt;code&gt;curl&lt;/code&gt; lies about audio
&lt;/h2&gt;

&lt;p&gt;I imported a batch of stations and validated each stream like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /dev/null &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="s2"&gt;"%{http_code} %{content_type}"&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; 0-1 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$URL&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="c"&gt;# 200 audio/mpeg  ... right?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;200 audio/mpeg&lt;/code&gt; looked like a pass. &lt;strong&gt;It wasn't.&lt;/strong&gt; Plenty of those streams returned a clean &lt;code&gt;200&lt;/code&gt; to &lt;code&gt;curl&lt;/code&gt; but refused to play in a browser. &lt;code&gt;curl&lt;/code&gt; checks that bytes come back; it does &lt;strong&gt;not&lt;/strong&gt; check that a browser's &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; element can actually decode and play them.&lt;/p&gt;

&lt;p&gt;So I tested them the only way that's truthful — real playback in a headless browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;canPlay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;14000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Audio&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;done&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;canplay&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;OK&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;loadeddata&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;OK&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ERR&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
    &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TIMEOUT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;ms&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things this caught that &lt;code&gt;curl&lt;/code&gt; never could:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Icecast root mounts often need a trailing &lt;code&gt;;&lt;/code&gt;.&lt;/strong&gt; &lt;code&gt;https://host:9152/&lt;/code&gt; threw &lt;code&gt;MediaError code 4&lt;/code&gt; (source not supported), but &lt;code&gt;https://host:9152/;&lt;/code&gt; played perfectly. That semicolon is an old SHOUTcast/Icecast trick to force the audio mount instead of a status page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Some codecs just don't play in &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt;.&lt;/strong&gt; A whole CDN's worth of HE-AAC / Opus streams returned &lt;code&gt;200&lt;/code&gt; to &lt;code&gt;curl&lt;/code&gt; but timed out in the browser — they never reached &lt;code&gt;canplay&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use a generous timeout.&lt;/strong&gt; My first pass used 8s and produced ~12 false negatives — working streams that are just slow to buffer. At 14s they all passed. Don't disable a station on one short timeout.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Takeaway: &lt;strong&gt;if your product's core action is "media plays in a browser," validate it in a browser.&lt;/strong&gt; An HTTP status code is not playback.&lt;/p&gt;

&lt;h2&gt;
  
  
  A visualizer without breaking playback (CORS)
&lt;/h2&gt;

&lt;p&gt;I wanted an audio visualizer (Web Audio &lt;code&gt;AnalyserNode&lt;/code&gt;), but that needs &lt;code&gt;crossOrigin = "anonymous"&lt;/code&gt;, which fails on the ~30% of streams that don't send CORS headers. The fix: &lt;strong&gt;two audio elements.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;fxAudio&lt;/code&gt; — &lt;code&gt;crossOrigin = "anonymous"&lt;/code&gt;, routed through the Web Audio graph (visualizer works).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;plainAudio&lt;/code&gt; — no CORS, the fallback that always plays.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try &lt;code&gt;fxAudio&lt;/code&gt; first; on failure, cache that the station has no CORS and replay it on &lt;code&gt;plainAudio&lt;/code&gt;. You get the visualizer where possible and never sacrifice playback.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why no AdSense
&lt;/h2&gt;

&lt;p&gt;It was tempting, but ad networks force a cookie-consent banner and tank load time. For a utility people open to &lt;em&gt;press play and leave it running&lt;/em&gt;, that's the wrong trade. The site stays cookie-free and fast; if it grows, I'll monetize directly (featured-station placements), not via ad networks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;p&gt;Boring stack, static pages, ruthless validation. If you want to see the result, it's live at &lt;strong&gt;&lt;a href="https://radiobalkan.net/" rel="noopener noreferrer"&gt;radiobalkan.net&lt;/a&gt;&lt;/strong&gt; — and if you know a Balkan station that's missing, tell me and I'll add it.&lt;/p&gt;

&lt;p&gt;Happy to answer questions about the SEO generation or the stream-testing setup in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>supabase</category>
      <category>seo</category>
    </item>
  </channel>
</rss>
