Portable .Net library for Last.fm
Go to file
2015-06-27 22:30:18 +02:00
.nuget Fixing NuGet on the build server 2015-05-01 10:50:01 +01:00
doc code formatting in contributing.md 2015-06-20 16:48:23 +02:00
res Forgot to add the picture 2014-11-09 16:47:44 +00:00
src Implemented user.getTopArtists 2015-06-27 22:30:18 +02:00
.gitattributes Initial commit 2013-06-08 18:49:21 +01:00
.gitignore Ignore VS 2015 ide folder 2015-04-04 18:26:06 +01:00
appveyor.yml Aight then, just copying nupkgs to root after packing because it's easier than fiddling with the regex 2015-05-01 16:27:15 +01:00
coverage.ps1 Include integration tests in code coverage report 2015-01-04 04:04:58 +00:00
IF.Lastfm.sln Return ignored scrobbles on ScrobbleResponses 2015-04-26 18:32:20 +01:00
IF.Lastfm.sln.DotSettings Fixing progress report 2014-11-08 15:34:46 +00:00
LICENCE.md Update LICENCE.md 2014-09-16 18:29:54 +01:00
PROGRESS.md tag.getSimilar, tidying some tests 2015-06-21 19:58:04 +01:00
README.md Updating docs 2015-05-19 13:34:11 +01:00
run-tests.ps1 Fix scrobble request body tests 2015-04-23 22:51:26 +01:00

Inflatable Last.fm .NET SDK

Code licence Build status ![Gitter](https://badges.gitter.im/Join Chat.svg)

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 the SDK

NuGet - production code

Install the NuGet package. Search for Inflatable.Lastfm in the NuGet package browser.

NuGet - prerelease code

There is a NuGet package built for every commit to master. Add https://ci.appveyor.com/nuget/lastfm-ql51ic53xoqw to your NuGet package sources, and install the IF.Lastfm.Core prerelease package.

From source

Clone this repo and reference IF.Lastfm.Core in your application. Your IDE needs to support building portable libraries - Visual Studio 2013 Community or better.

Using the SDK

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 = 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 library is compatible with:

  • .NET 4.5 (including Mono)
  • Windows 8.0
  • Windows Phone 8.1
  • Windows Phone Silverlight 8
  • Xamarin.Android and Xamarin.iOS

If you need support for Windows Phone 7, or another .NET platform, it's probably easy enough. Raise an issue or send a PR.

Credits

Maintained by @rikkilt. Thanks to all contributors!