Commits

Sergio Tapia committed 682ed72

Renamed the folders. :)

  • Participants
  • Parent commits 9299008

Comments (0)

Files changed (19)

CherryTomato.Examples/CherryTomato.Examples.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>CherryTomato.Examples</RootNamespace>
+    <AssemblyName>CherryTomatoe.Examples</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\CherryTomatoe\CherryTomato.csproj">
+      <Project>{FFF019A4-DB0B-452A-83AE-C967A546A278}</Project>
+      <Name>CherryTomato</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

CherryTomato.Examples/Program.cs

+using System;
+using System.Configuration;
+
+
+namespace CherryTomato.Examples
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            string apiKey = ConfigurationManager.AppSettings["ApiKey"];
+            var tomatoe = new Tomatoe(apiKey);
+            var movie = tomatoe.FindMovie(9818);
+
+            Console.WriteLine(movie.Name);
+            Console.WriteLine(movie.Year);
+            foreach (var rating in movie.Ratings)
+            {
+                Console.WriteLine("{0} Rating: {1}", rating.Type, rating.Score);
+            }
+
+            Console.ReadKey();
+        }
+    }
+}

CherryTomato.Examples/Properties/AssemblyInfo.cs

+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("CherryTomatoe.Examples")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("CherryTomatoe.Examples")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("45c81dc4-8b4f-46fa-8a7c-d7813f0b2738")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

CherryTomato.sln

-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CherryTomato", "CherryTomatoe\CherryTomato.csproj", "{FFF019A4-DB0B-452A-83AE-C967A546A278}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CherryTomato.Examples", "CherryTomatoe.Examples\CherryTomato.Examples.csproj", "{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Debug|Mixed Platforms = Debug|Mixed Platforms
-		Debug|x86 = Debug|x86
-		Release|Any CPU = Release|Any CPU
-		Release|Mixed Platforms = Release|Mixed Platforms
-		Release|x86 = Release|x86
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Release|Any CPU.Build.0 = Release|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{FFF019A4-DB0B-452A-83AE-C967A546A278}.Release|x86.ActiveCfg = Release|Any CPU
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Debug|Any CPU.ActiveCfg = Debug|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Debug|Mixed Platforms.Build.0 = Debug|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Debug|x86.ActiveCfg = Debug|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Debug|x86.Build.0 = Debug|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Release|Any CPU.ActiveCfg = Release|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Release|Mixed Platforms.ActiveCfg = Release|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Release|Mixed Platforms.Build.0 = Release|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Release|x86.ActiveCfg = Release|x86
-		{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}.Release|x86.Build.0 = Release|x86
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

CherryTomato/CherryTomato.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{FFF019A4-DB0B-452A-83AE-C967A546A278}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>CherryTomato</RootNamespace>
+    <AssemblyName>CherryTomatoe</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Newtonsoft.Json">
+      <HintPath>..\packages\Newtonsoft.Json.4.0.1\lib\40\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Entities\Movie.cs" />
+    <Compile Include="Entities\MovieSearchResult.cs" />
+    <Compile Include="Parser.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Tomatoe.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

CherryTomato/Entities/Movie.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace CherryTomato.Entities
+{
+    public class Movie
+    {
+        public int RottenTomatoesId { get; set; }
+        public string Name { get; set; }
+        public int Year { get; set; }
+        public string MpaaRating { get; set; }
+        public int Runtime { get; set; }
+        public string Synopsis { get; set; }
+        public List<ReleaseDate> ReleaseDates { get; set; }
+        public List<Rating> Ratings { get; set; }
+        public List<string> Genres { get; set; }
+        public List<string> Directors { get; set; }
+        public List<CastMember> Cast { get; set; }
+        public List<Link> Links { get; set; }
+        public List<Poster> Posters { get; set; }
+
+        public Movie()
+        {
+            Directors = new List<string>();
+            Genres = new List<string>();
+            Cast = new List<CastMember>();
+            Links = new List<Link>();
+            Posters = new List<Poster>();
+            ReleaseDates = new List<ReleaseDate>();
+            Ratings = new List<Rating>();
+        }
+    }
+
+    public class ReleaseDate
+    {
+        public string Type { get; set; }
+        public DateTime Date { get; set; }
+    }
+
+    public class CastMember
+    {
+        public string Actor { get; set; }
+        public List<string> Characters { get; set; }
+
+        public CastMember()
+        {
+            Characters = new List<string>();
+        }
+    }
+
+    public class Link
+    {
+        public string Type { get; set; }
+        public string Url { get; set; }
+    }
+
+    public class Poster
+    {
+        public string Type { get; set; }
+        public string Url { get; set; }
+    }
+
+    public class Rating
+    {
+        public string Type { get; set; }
+        public int Score { get; set; }
+    }
+}

CherryTomato/Entities/MovieSearchResult.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace CherryTomato.Entities
+{
+    public class MovieSearchResult
+    {
+
+    }
+}

CherryTomato/Parser.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using CherryTomato.Entities;
+using Newtonsoft.Json.Linq;
+
+namespace CherryTomato
+{
+    public static class Parser
+    {
+        public static Movie ParseMovie(string json)
+        {
+            JObject x = JObject.Parse(json);
+            Movie movie = new Movie();
+
+            movie.RottenTomatoesId = (int) x["id"];
+            movie.Name = (string) x["title"];
+            movie.Year = (int)x["year"];
+            movie.MpaaRating = (string) x["mpaa_rating"];
+            movie.Runtime = (int) x["runtime"];
+            movie.Synopsis = (string)x["synopsis"];
+
+            var directors = (JArray) x["abridged_directors"];
+            foreach (var director in directors)
+            {
+                movie.Directors.Add((string)director["name"]);
+            }
+
+            var genres = (JArray) x["genres"];
+            foreach (var genre in genres)
+            {
+                movie.Genres.Add((string)genre);
+            }
+
+            var castMembers = (JArray) x["abridged_cast"];
+            foreach (var castMember in castMembers)
+            {
+                CastMember member = new CastMember();
+                member.Actor = (string) castMember["name"];
+                var characters = (JArray) castMember["characters"];
+                foreach (var character in characters)
+                {
+                    member.Characters.Add((string)character);
+                    movie.Cast.Add(member);
+                }
+            }
+
+            var links = (JObject)x["links"];
+            foreach (var link in links)
+            {
+                Link newLink = new Link();
+                newLink.Type = (string)link.Key;
+                newLink.Url = (string)link.Value;
+                movie.Links.Add(newLink);
+            }
+
+            var posters = (JObject)x["posters"];
+            foreach (var poster in posters)
+            {
+                Poster newPoster = new Poster();
+                newPoster.Type = (string)poster.Key;
+                newPoster.Url = (string)poster.Value;
+                movie.Posters.Add(newPoster);
+            }
+
+            var ratings = (JObject)x["ratings"];
+            foreach (var rating in ratings)
+            {
+                Rating newRating = new Rating();
+                newRating.Type = (string)rating.Key;
+                newRating.Score = (int)rating.Value;
+                movie.Ratings.Add(newRating);
+            }
+
+            var dates = (JObject)x["release_dates"];
+            foreach (var date in dates)
+            {
+                ReleaseDate releaseDate = new ReleaseDate();
+                releaseDate.Type = (string)date.Key;
+                var tmpDate = ((string) date.Value).Substring(0, ((string) date.Value).Count());
+                releaseDate.Date = DateTime.Parse(tmpDate);
+                movie.ReleaseDates.Add(releaseDate);
+            }
+
+            return movie;
+        }
+
+        public static List<MovieSearchResult> ParseMovieSearchResults(string json)
+        {
+            return new List<MovieSearchResult>();
+        }
+    }
+}

CherryTomato/Properties/AssemblyInfo.cs

+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("CherryTomatoe")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("CherryTomatoe")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("77aced07-6135-4516-a342-7bd1a47f590f")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

CherryTomato/Tomatoe.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Text;
+using CherryTomato.Entities;
+
+namespace CherryTomato
+{
+    public class Tomatoe
+    {
+        public string ApiKey { get; set; }
+
+        public Tomatoe(string apiKey)
+        {
+            ApiKey = apiKey;
+        }
+
+        public Movie FindMovie(int movieId)
+        {
+            var url = String.Format(@"http://api.rottentomatoes.com/api/public/v1.0/movies/{0}.json?apikey={1}", movieId, ApiKey);
+            string response;
+
+            using (var client = new WebClient())
+            {
+                response = client.DownloadString(url);
+            }
+
+            Movie movie = Parser.ParseMovie(response);
+            return movie;
+        }
+
+        public List<MovieSearchResult> SearchMovie(string query)
+        {
+            var url = String.Format(@"http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey={0}&q={1}&page_limit=1", ApiKey, query);
+            string response;
+
+            using (var client = new WebClient())
+            {
+                response = client.DownloadString(url);
+            }
+
+            List<MovieSearchResult> results = Parser.ParseMovieSearchResults(response);
+            return results;
+        }
+    }
+}

CherryTomatoe.Examples/CherryTomato.Examples.csproj

-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{6E6CE7D3-68CB-498A-9FF7-FD07E3E099F0}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>CherryTomato.Examples</RootNamespace>
-    <AssemblyName>CherryTomatoe.Examples</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.configuration" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\CherryTomatoe\CherryTomato.csproj">
-      <Project>{FFF019A4-DB0B-452A-83AE-C967A546A278}</Project>
-      <Name>CherryTomato</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="App.config" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>

CherryTomatoe.Examples/Program.cs

-using System;
-using System.Configuration;
-
-
-namespace CherryTomato.Examples
-{
-    class Program
-    {
-        static void Main(string[] args)
-        {
-            string apiKey = ConfigurationManager.AppSettings["ApiKey"];
-            var tomatoe = new Tomatoe(apiKey);
-            var movie = tomatoe.FindMovie(9818);
-
-            Console.WriteLine(movie.Name);
-            Console.WriteLine(movie.Year);
-            foreach (var rating in movie.Ratings)
-            {
-                Console.WriteLine("{0} Rating: {1}", rating.Type, rating.Score);
-            }
-
-            Console.ReadKey();
-        }
-    }
-}

CherryTomatoe.Examples/Properties/AssemblyInfo.cs

-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CherryTomatoe.Examples")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("CherryTomatoe.Examples")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("45c81dc4-8b4f-46fa-8a7c-d7813f0b2738")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

CherryTomatoe/CherryTomato.csproj

-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{FFF019A4-DB0B-452A-83AE-C967A546A278}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>CherryTomato</RootNamespace>
-    <AssemblyName>CherryTomatoe</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="Newtonsoft.Json">
-      <HintPath>..\packages\Newtonsoft.Json.4.0.1\lib\40\Newtonsoft.Json.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Entities\Movie.cs" />
-    <Compile Include="Entities\MovieSearchResult.cs" />
-    <Compile Include="Parser.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Tomatoe.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>

CherryTomatoe/Entities/Movie.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace CherryTomato.Entities
-{
-    public class Movie
-    {
-        public int RottenTomatoesId { get; set; }
-        public string Name { get; set; }
-        public int Year { get; set; }
-        public string MpaaRating { get; set; }
-        public int Runtime { get; set; }
-        public string Synopsis { get; set; }
-        public List<ReleaseDate> ReleaseDates { get; set; }
-        public List<Rating> Ratings { get; set; }
-        public List<string> Genres { get; set; }
-        public List<string> Directors { get; set; }
-        public List<CastMember> Cast { get; set; }
-        public List<Link> Links { get; set; }
-        public List<Poster> Posters { get; set; }
-
-        public Movie()
-        {
-            Directors = new List<string>();
-            Genres = new List<string>();
-            Cast = new List<CastMember>();
-            Links = new List<Link>();
-            Posters = new List<Poster>();
-            ReleaseDates = new List<ReleaseDate>();
-            Ratings = new List<Rating>();
-        }
-    }
-
-    public class ReleaseDate
-    {
-        public string Type { get; set; }
-        public DateTime Date { get; set; }
-    }
-
-    public class CastMember
-    {
-        public string Actor { get; set; }
-        public List<string> Characters { get; set; }
-
-        public CastMember()
-        {
-            Characters = new List<string>();
-        }
-    }
-
-    public class Link
-    {
-        public string Type { get; set; }
-        public string Url { get; set; }
-    }
-
-    public class Poster
-    {
-        public string Type { get; set; }
-        public string Url { get; set; }
-    }
-
-    public class Rating
-    {
-        public string Type { get; set; }
-        public int Score { get; set; }
-    }
-}

CherryTomatoe/Entities/MovieSearchResult.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace CherryTomato.Entities
-{
-    public class MovieSearchResult
-    {
-
-    }
-}

CherryTomatoe/Parser.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using CherryTomato.Entities;
-using Newtonsoft.Json.Linq;
-
-namespace CherryTomato
-{
-    public static class Parser
-    {
-        public static Movie ParseMovie(string json)
-        {
-            JObject x = JObject.Parse(json);
-            Movie movie = new Movie();
-
-            movie.RottenTomatoesId = (int) x["id"];
-            movie.Name = (string) x["title"];
-            movie.Year = (int)x["year"];
-            movie.MpaaRating = (string) x["mpaa_rating"];
-            movie.Runtime = (int) x["runtime"];
-            movie.Synopsis = (string)x["synopsis"];
-
-            var directors = (JArray) x["abridged_directors"];
-            foreach (var director in directors)
-            {
-                movie.Directors.Add((string)director["name"]);
-            }
-
-            var genres = (JArray) x["genres"];
-            foreach (var genre in genres)
-            {
-                movie.Genres.Add((string)genre);
-            }
-
-            var castMembers = (JArray) x["abridged_cast"];
-            foreach (var castMember in castMembers)
-            {
-                CastMember member = new CastMember();
-                member.Actor = (string) castMember["name"];
-                var characters = (JArray) castMember["characters"];
-                foreach (var character in characters)
-                {
-                    member.Characters.Add((string)character);
-                    movie.Cast.Add(member);
-                }
-            }
-
-            var links = (JObject)x["links"];
-            foreach (var link in links)
-            {
-                Link newLink = new Link();
-                newLink.Type = (string)link.Key;
-                newLink.Url = (string)link.Value;
-                movie.Links.Add(newLink);
-            }
-
-            var posters = (JObject)x["posters"];
-            foreach (var poster in posters)
-            {
-                Poster newPoster = new Poster();
-                newPoster.Type = (string)poster.Key;
-                newPoster.Url = (string)poster.Value;
-                movie.Posters.Add(newPoster);
-            }
-
-            var ratings = (JObject)x["ratings"];
-            foreach (var rating in ratings)
-            {
-                Rating newRating = new Rating();
-                newRating.Type = (string)rating.Key;
-                newRating.Score = (int)rating.Value;
-                movie.Ratings.Add(newRating);
-            }
-
-            var dates = (JObject)x["release_dates"];
-            foreach (var date in dates)
-            {
-                ReleaseDate releaseDate = new ReleaseDate();
-                releaseDate.Type = (string)date.Key;
-                var tmpDate = ((string) date.Value).Substring(0, ((string) date.Value).Count());
-                releaseDate.Date = DateTime.Parse(tmpDate);
-                movie.ReleaseDates.Add(releaseDate);
-            }
-
-            return movie;
-        }
-
-        public static List<MovieSearchResult> ParseMovieSearchResults(string json)
-        {
-            return new List<MovieSearchResult>();
-        }
-    }
-}

CherryTomatoe/Properties/AssemblyInfo.cs

-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CherryTomatoe")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("CherryTomatoe")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("77aced07-6135-4516-a342-7bd1a47f590f")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

CherryTomatoe/Tomatoe.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Text;
-using CherryTomato.Entities;
-
-namespace CherryTomato
-{
-    public class Tomatoe
-    {
-        public string ApiKey { get; set; }
-
-        public Tomatoe(string apiKey)
-        {
-            ApiKey = apiKey;
-        }
-
-        public Movie FindMovie(int movieId)
-        {
-            var url = String.Format(@"http://api.rottentomatoes.com/api/public/v1.0/movies/{0}.json?apikey={1}", movieId, ApiKey);
-            string response;
-
-            using (var client = new WebClient())
-            {
-                response = client.DownloadString(url);
-            }
-
-            Movie movie = Parser.ParseMovie(response);
-            return movie;
-        }
-
-        public List<MovieSearchResult> SearchMovie(string query)
-        {
-            var url = String.Format(@"http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey={0}&q={1}&page_limit=1", ApiKey, query);
-            string response;
-
-            using (var client = new WebClient())
-            {
-                response = client.DownloadString(url);
-            }
-
-            List<MovieSearchResult> results = Parser.ParseMovieSearchResults(response);
-            return results;
-        }
-    }
-}