Skip to content

Latest commit

 

History

History
93 lines (72 loc) · 2.31 KB

README.md

File metadata and controls

93 lines (72 loc) · 2.31 KB

iTunesSearch Build status NuGet

A .NET wrapper to the iTunes search API

Quick Start

Install the NuGet package from the package manager console:

Install-Package iTunesSearch

Examples

Get TV episodes for a show name:
//  Arrange
iTunesSearchManager search = new iTunesSearchManager();
string showName = "Modern Family";

//  Act
var items = search.GetTVEpisodesForShow(showName, 200).Result;

//  Assert
Assert.IsTrue(items.Episodes.Any());
Group episodes for a season:
//  Arrange
iTunesSearchManager search = new iTunesSearchManager();
string showName = "Modern Family";

//  Act
var items = search.GetTVEpisodesForShow(showName, 200).Result;
var seasons = from episode in items.Episodes
              orderby episode.Number
                 group episode by episode.SeasonNumber into seasonGroup
                 orderby seasonGroup.Key
                 select seasonGroup;

//  Assert
foreach(var seasonGroup in seasons)
{
    Debug.WriteLine("Season number: {0}", seasonGroup.Key);

    foreach(TVEpisode episode in seasonGroup)
    {
        Debug.WriteLine("Ep {0}: {1}", episode.Number, episode.Name);
    }
}
Get TV seasons for a show:
 //  Arrange
iTunesSearchManager search = new iTunesSearchManager();
string showName = "Modern Family";

//  Act
var items = search.GetTVSeasonsForShow(showName).Result;

//  Assert
Assert.IsTrue(items.Seasons.Any());
Get TV seasons for a given show name and country code:
 //  Arrange
iTunesSearchManager search = new iTunesSearchManager();
string showName = "King of the Hill";
string countryCode = "AU"; /* Australia */

//  Act
var items = search.GetTVSeasonsForShow(showName, 20, countryCode).Result;

//  Assert
Assert.IsTrue(items.Seasons.Any());
Get podcasts for a given name:
//  Arrange
iTunesSearchManager search = new iTunesSearchManager();
string showName = "Radiolab";

//  Act
var items = search.GetPodcasts(showName, 200).Result;

//  Assert
Assert.IsTrue(items.Podcasts.Any());