for now...dont deal with the default image
This commit is contained in:
@@ -9,10 +9,10 @@ namespace GravatarWrapper.Test
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestMethod1()
|
public void TestMethod1()
|
||||||
{
|
{
|
||||||
var req = GravatarWrapper.Request("test@mctest.com", 400, false);
|
var req = GravatarWrapper.Request("tparnell@vistaprint.com", 400);
|
||||||
if (req != null)
|
if (req != null)
|
||||||
{
|
{
|
||||||
req.Save(@"c:\users\test\Desktop\bmp.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
|
req.Save(@"c:\users\tommy\Desktop\bmp.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,11 +32,10 @@ namespace GravatarWrapper
|
|||||||
return sBuilder.ToString(); // Return the hexadecimal string.
|
return sBuilder.ToString(); // Return the hexadecimal string.
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Bitmap Request(string email, int size, bool ShowDefaultImage)
|
public static Bitmap Request(string email, int size)
|
||||||
{
|
{
|
||||||
var client = new RestClient("http://www.gravatar.com/avatar/" + HashEmailForGravatar(email));
|
var client = new RestClient("http://www.gravatar.com/avatar/" + HashEmailForGravatar(email));
|
||||||
var req = new RestRequest(Method.GET);
|
var req = new RestRequest(Method.GET);
|
||||||
if (!ShowDefaultImage) req.AddParameter("d", "%22%22" );
|
|
||||||
req.AddParameter("s", size);
|
req.AddParameter("s", size);
|
||||||
var res = client.Execute(req);
|
var res = client.Execute(req);
|
||||||
if (res != null)
|
if (res != null)
|
||||||
|
|||||||
@@ -30,6 +30,10 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="RestSharp, Version=104.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\packages\RestSharp.104.4.0\lib\net4\RestSharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@@ -40,6 +44,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Exceptions\NoResponseReturnedException.cs" />
|
||||||
<Compile Include="GravatarWrapper.cs" />
|
<Compile Include="GravatarWrapper.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user