Atradio (atradio_ex v0.1.0)

Copy Markdown View Source

Official Elixir SDK for atradio.fm.

A thin wrapper over the :atradio_erl NIF package (the shared Rust core): AppView reads, record writes, and the deterministic favorite key — identical to the Rust, Go, TypeScript, Python, Ruby, and Clojure SDKs. :atradio_erl downloads the matching native library from the GitHub release on first use.

Reads return lists/maps with binary keys (the wire shape). Stations passed to the write verbs are maps with binary keys — "stationId", "name", "streamUrl", "source".

iex> Atradio.recent_stations(5) |> Enum.map(& &1["station"]["name"])
iex> Atradio.favorite_rkey("rb:...")   # 16-char hex, matches every SDK

Summary

Functions

Post a comment on a station.

Delete the actor's play-status singleton.

Favorite a station (idempotent; deterministic record key).

The deterministic favorite record key — identical across every atradio SDK.

An actor's favorited stations.

Platform-wide who's-listening feed.

Log in with an app password, persisting the session at session_path. Returns an opaque agent handle (a resource freed by GC).

Most-favorited stations platform-wide.

Newest stations platform-wide.

Proactively refresh the session (keep-alive).

Update the actor's play-status singleton.

Unfavorite a station (removes every record for its stationId).

Functions

comment(agent, station, text)

Post a comment on a station.

delete_play_status(agent)

Delete the actor's play-status singleton.

favorite(agent, station)

Favorite a station (idempotent; deterministic record key).

favorite_rkey(station_id)

The deterministic favorite record key — identical across every atradio SDK.

favorites(actor, limit \\ 50, base \\ "")

An actor's favorited stations.

global_recently_played(limit \\ 50, base \\ "")

Platform-wide who's-listening feed.

login(session_path, identifier, password, appview \\ "")

Log in with an app password, persisting the session at session_path. Returns an opaque agent handle (a resource freed by GC).

recent_stations(limit \\ 50, base \\ "")

Newest stations platform-wide.

refresh_session(agent)

Proactively refresh the session (keep-alive).

set_play_status(agent, station)

Update the actor's play-status singleton.

unfavorite(agent, station)

Unfavorite a station (removes every record for its stationId).