Skip to content

now

Handle currently running show.

get_show()

Get the currently running show.

Calls the the nowplaying songticker's API.

Returns

Name of the currently running show.
Source code in cridlib/strategy/now.py
def get_show() -> str:
    """Get the currently running show.

    Calls the the [nowplaying](https://github.com/radiorabe/nowplaying)
    songticker's API.

    Returns
    -------
        Name of the currently running show.

    """
    _resp = get_session().get(__SONGTICKER_URL, timeout=10)
    _tree = ET.fromstring(_resp.text)  # noqa: S314
    _path = PurePath(urisplit(_tree[3][1].text).path)
    return _path.stem