Crates.io | rustfm-scrobble |
lib.rs | rustfm-scrobble |
version | 1.1.1 |
source | src |
created_at | 2017-02-22 19:47:29.627691 |
updated_at | 2021-01-13 12:18:10.957408 |
description | Last.fm Scrobble crate for Rust |
homepage | |
repository | https://github.com/bobbo/rustfm-scrobble |
max_upload_size | |
id | 8636 |
size | 90,576 |
rustfm-scrobble is a Last.fm Scrobble API 2.0 crate for Rust. It allows easy acccess to the "scrobble" and "now playing" notification endpoints through a simple Rust API. It can be used to record song-plays from music players, build analog scrobbling tools similar to VinylScrobbler or work with IoT Devices. It was initially built to implement a Spotify scrobbling service using the Spotify Connect Protocol when the Alexa Spotify client did not support scrobbling plays to Last.fm.
Scrobbler::scrobble_batch
and ScrobbleBatch
Result
with a simple Error
type on failureAdd rustfm-scrobble to your Cargo.toml.
[dependencies]
rustfm-scrobble="1.1"
cargo build --examples
./target/debug/examples/example
cargo build
cargo test
extern crate rustfm_scrobble;
use rustfm_scrobble::{Scrobble, Scrobbler};
let username = "last-fm-username";
let password = "last-fm-password";
let api_key = "client-api-key";
let api_secret = "client-api-secret";
let mut scrobbler = Scrobbler::new(api_key, api_secret);
scrobbler.authenticate_with_password(username, password);
let song = Scrobble::new("Example Artist", "Example Song", "Example Album");
scrobbler.scrobble(song);
rustfm-scrobble is used in several projects including polaris, connectr, rescrobbled and rb-scrobbler.
The API is stable & backwards compatibility will be guaranteed for all 1.0 releases.
MIT license, see ./LICENSE
.