Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alt-art/genius-rs
Rust library that allows interact with Genius API
https://github.com/alt-art/genius-rs
genius-api genius-lyrics rust
Last synced: about 2 months ago
JSON representation
Rust library that allows interact with Genius API
- Host: GitHub
- URL: https://github.com/alt-art/genius-rs
- Owner: alt-art
- License: mit
- Archived: true
- Created: 2021-04-16T23:03:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-17T21:04:26.000Z (over 1 year ago)
- Last Synced: 2024-11-19T23:10:23.986Z (about 2 months ago)
- Topics: genius-api, genius-lyrics, rust
- Language: Rust
- Homepage: https://crates.io/crates/genius-rs
- Size: 67.4 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Crates.io](https://img.shields.io/crates/v/genius-rs?color=%2300aa00&style=flat-square) ![Crates.io (recent)](https://img.shields.io/crates/dr/genius-rs?style=flat-square) ![Crates.io](https://img.shields.io/crates/l/genius-rs?style=flat-square)
# genius_rs
Rust library that allows interact with Genius API.
> [!WARNING]
> This library is not maintained anymore due to my lack of interest in genius and my change of focus in development to developing “[commit](https://github.com/alt-art/commit)”## Searching for a song
```rust
use genius_rs::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);
}
```## Getting lyrics
```rust
use genius_rs::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);
}
}
```## Getting deeper information for a song by id
```rust
use genius_rs::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)
}
```