Giter VIP home page Giter VIP logo

lastfm's Introduction

Inflatable Last.fm .NET SDK

Project logo

Code licence

Project Goals

  • To provide complete .NET bindings for the Last.fm REST API
  • To build useful components for Last.fm applications
  • To be the very best, like no-one ever was

Contributing

Input is always welcome! Raise an issue on GitHub, or send a message to the Gitter chatroom if you need help with the library.

If you're interested in contributing code or documentation, this short introduction to the library will help you get started.

Quickstart

Installing

NuGet

Install Inflatable.Lastfm from NuGet.

NuGet - prerelease code

  1. Install the .NET Core SDK
  2. Clone this repo and checkout to the commit you need
  3. Run dotnet pack
  4. Reference the built NuGet package file in your project

Examples

First, sign up for Last.fm API access if you haven't already.

Create a LastfmClient:

var client = new LastfmClient("apikey", "apisecret");

Get information about an album:

var response = await client.Album.GetInfoAsync("Grimes", "Visions");

LastAlbum visions = response.Content;

For methods that return several items, you can iterate over the response:

var pageResponse = await client.Artist.GetTopTracksAsync("Ben Frost", page: 5, itemsPerPage: 100);

var trackNames = pageResponse.Select(track => track.Name);

Several API methods require user authentication. Once you have your user's Last.fm username and password, you can authenticate your instance of LastfmClient:

var response = await client.Auth.GetSessionTokenAsync("username", "pass");

// or load an existing session
UserSession cachedSession;
var succesful = client.Auth.LoadSession(cachedSession);

Authenticated methods then work like any other

if (client.Auth.HasAuthenticated) {
	var response = await client.Track.LoveAsync("Ibi Dreams of Pavement (A Better Day)", "Broken Social Scene");
}

Documentation

Platform Compatibility

The main package targets netstandard1.1. Development is on the master branch.

Dependencies

  • Newtonsoft.Json 9.0.1 =<
  • System.Net.Http 4.3.0 =<

Supported platforms

Check this table for supported platforms.

Other platforms

If you need support for a .NET platform that doesn't support .Net Standard 1.1, first see if the feature you need is available in v0.3 or earlier - that version targeted PCL profile 259, and so is compatible with e.g. Windows 8.0 and Windows Phone 7.

If you need a feature for these older platforms, please raise an issue.

Credits

Maintained by @rikkilt. Thanks to all contributors!

lastfm's People

Contributors

branc116 avatar c-d avatar fckoppenol avatar haroldma-zz avatar kasthack avatar klinge avatar l-dogg avatar mlaily avatar pcurd avatar piotrwiewiura avatar prashantkhandelwal avatar qstick avatar realworld666 avatar rikkit avatar rms81 avatar seafea avatar shoegazessb avatar stealthin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.