chartlyrics 0.2.1

Rust bindings for the ChartLyrics lyric API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use url_escape::encode_fragment as escape;

static API_URL: &str = "http://api.chartlyrics.com/apiv1.asmx";

pub fn search_lyric_direct(song: &str, artist: &str) -> String {
    let song = escape(song);
    let artist = escape(artist);
    format!("{API_URL}/SearchLyricDirect?song={song}&artist={artist}")
}

pub fn search_lyric_text(text: &str) -> String {
    let text = escape(text);
    format!("{API_URL}/SearchLyricText?lyricText={text}")
}