tfmart / ScrobbleKit

A Swift library for interacting with the Last.fm API on Apple platforms

Home Page:https://tfmart.github.io/ScrobbleKit/documentation/scrobblekit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ScrobbleKit

ScrobbleKit is a Swift library designed to simplify interactions with the Last.fm API on Apple platforms

Getting Started

To begin using ScrobbleKit, create an instance of SBKManager by providing your API and Secret key from Last.fm

import ScrobbleKit

let manager = SBKManager(apiKey: API_KEY,
                         secret: SECRET_KEY)

You can utilize the available API methods through the manager, which supports both async/await and completion handler-based approaches.

Async/Await

do {
    let album = try await manager.getInfo(forAlbum: .albumArtist(album: "Random Access Memories",
                                                                 artist: "Daft Punk"))
    // Use 'album' here
} catch {
    // Handle error
}

Completion Handler

manager.getInfo(forAlbum: .albumArtist(album: "Random Access Memories",
                                       artist: "Daft Punk"))
{ album, error in
    if let album = album {
        // Use 'album' here
    } else if let error = error {
        // Handle error
    }
}

For more detailed information on API methods available through ScrobbleKit, check out the full documentation

Requirements

  • iOS 13.0 or later
  • macOS Catalina or later
  • watchOS 6.0 or later
  • tvOS 13.0 or later

About

A Swift library for interacting with the Last.fm API on Apple platforms

https://tfmart.github.io/ScrobbleKit/documentation/scrobblekit

License:MIT License


Languages

Language:Swift 100.0%