-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGodaddyDelegation.cs
38 lines (28 loc) · 947 Bytes
/
GodaddyDelegation.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using AutoDomain.utils;
using Newtonsoft.Json.Linq;
namespace AutoDomain
{
class GodaddyDelegation
{
public static DomainInfo CheckDomain(string url)
{
string strJson = HttpHelper.Get(String.Format(@"https://find.godaddy.com/en/domainsapi/v1/search/exact?key=dpp_search&pc=&ptl=&q={0}", url));
JObject jRoot = JObject.Parse(strJson);
if (jRoot["ExactMatchDomain"].Value<Boolean>("IsAvailable") == false)
{
return null;
}
DomainInfo domainInfo = new DomainInfo();
domainInfo.URL = url;
double dListPrice = jRoot["Products"][0]["PriceInfo"].Value<Double>("ListPrice");
domainInfo.Price = dListPrice;
return domainInfo;
}
}
}