Crates.io | genius-rust |
lib.rs | genius-rust |
version | 0.1.1 |
source | src |
created_at | 2022-08-27 22:25:04.142105 |
updated_at | 2022-08-27 22:28:35.24455 |
description | Rust library that allows interact with Genius API |
homepage | |
repository | https://github.com/tsirysndr/genius-rust |
max_upload_size | |
id | 653634 |
size | 42,655 |
Rust library that allows interact with Genius API.
use genius_rust::Genius;
#[tokio::main]
async fn main() {
let genius = Genius::new(dotenv::var("TOKEN").unwrap());
let response = genius.search("Ariana Grande").await.unwrap();
println!("{}", response[0].result.full_title);
}
use genius_rust::Genius;
#[tokio::main]
async fn main() {
let genius = Genius::new(dotenv::var("TOKEN").unwrap());
let response = genius.search("Sia").await.unwrap();
let lyrics = genius.get_lyrics(&response[0].result.id).await.unwrap();
for verse in lyrics {
println!("{}", verse);
}
}
use genius_rust::Genius;
#[tokio::main]
async fn main() {
let genius = Genius::new(dotenv::var("TOKEN").unwrap());
let response = genius.search("Weeknd").await.unwrap();
let song = genius.get_song(response[0].result.id, "plain").await.unwrap();
println!("{}", song.media.unwrap()[0].url)
}