Пример #1
0
        public void SaveBackOrder(GoDaddyAccount account)
        {
            var backOrder = new BackOrders
            {
                OrderID = Guid.NewGuid(),
                GoDaddyAccount = account.AccountID,
                AlertEmail1 = View.AlertEmail1,
                AlertEmail2 = View.AlertEmail2,
                CreditsToUse = View.CreditstoUse,
                DateToOrder = View.DateToPlaceOrder,
                Private = false,
                DomainName = View.DomainName
            };

            Modal.SaveBackOrder(backOrder);
        }
Пример #2
0
 public BidsModel(GoDaddyAccount account, IDefaultView defaultView)
 {
     Ds = new ASEntities();
     Account = account;
     DefaultView = defaultView;
 }
Пример #3
0
 public IQueryable<BackOrders> GetBackOrders(GoDaddyAccount account)
 {
     return Modal.GetBackOrders(account);
 }
Пример #4
0
 public void SaveGoDaddyAccount(GoDaddyAccount account)
 {
     Model.SaveGodaddyAccount(account);
 }
Пример #5
0
        public void PlaceBid(GoDaddyAccount account, Auctions auction)
        {
            ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
            var url = "https://auctions.godaddy.com/trpSearchResults.aspx";
            using (var ds = new ASEntities())
            {
                var item = new AuctionHistory
                {
                    HistoryID = Guid.NewGuid(),
                    Text = "Logging In",
                    CreatedDate = GetPacificTime,
                    AuctionLink = auction.AuctionID
                };

                ds.AuctionHistory.Add(item);
                ds.SaveChanges();
            }
            if (Login(account.GoDaddyUsername, account.GoDaddyPassword))
            {
                var postData = string.Format("action=review_selected_add&items={0}_B_{1}_1|&rnd={2}&JlPYXTX=347bde7",
                    auction.AuctionRef, auction.MyBid,
                    RandomDouble(0, 1).ToString("0.00000000000000000"));
                var responseData = Post(url, postData);

                using (var ds = new ASEntities())
                {
                    var item = new AuctionHistory
                    {
                        HistoryID = Guid.NewGuid(),
                        Text = "Setting Max Bid: " + auction.MyBid,
                        CreatedDate = GetPacificTime,
                        AuctionLink = auction.AuctionID
                    };

                    ds.AuctionHistory.Add(item);
                    ds.SaveChanges();
                }

                //Review
                url = "https://auctions.godaddy.com/trpMessageHandler.aspx";
                postData = "q=ReviewDomains";
                responseData = Post(url, postData);

                if (responseData.Contains("ERROR: Bid must be a minimum of"))
                {
                    using (var ds = new ASEntities())
                    {
                        var item = new AuctionHistory
                        {
                            HistoryID = Guid.NewGuid(),
                            Text = "Bid Process Ended - Your max bid is already too small to place",
                            CreatedDate = GetPacificTime,
                            AuctionLink = auction.AuctionID
                        };

                        ds.AuctionHistory.Add(item);
                        ds.SaveChanges();
                    }
                    return;
                }

                //KeepAlive
                Get("https://auctions.godaddy.com/trpMessageHandler.aspx?keepAlive=1");
                Get("https://idp.godaddy.com/KeepAlive.aspx?SPKey=GDDNAEB002");

                url = string.Format("https://img.godaddy.com/pageevents.aspx?page_name=/trphome.aspx&ci=37022" +
                                    "&eventtype=click&ciimpressions=&usrin=&relativeX=659&relativeY=325&absoluteX=659&" +
                                    "absoluteY=1102&r={0}&comview=0", RandomDouble(0, 1).ToString("0.00000000000000000"));
                responseData = Get(url);

                // Buy
                var view = ExtractViewStateSearch(responseData);
                url = @"https://auctions.godaddy.com/trpItemListingReview.aspx";
                postData = "__VIEWSTATE=" + Viewstates +
                           string.Format("&hidAdvSearch=ddlAdvKeyword%3A1%7CtxtKeyword%3Aportal" +
                                         "%7CddlCharacters%3A0%7CtxtCharacters%3A%7CtxtMinTraffic%3A%7CtxtMaxTraffic%3A%" +
                                         "7CtxtMinDomainAge%3A%7CtxtMaxDomainAge%3A%7CtxtMinPrice%3A%7CtxtMaxPrice%3A%7Cdd" +
                                         "lCategories%3A0%7CchkAddBuyNow%3Afalse%7CchkAddFeatured%3Afalse%7CchkAddDash%3Atrue" +
                                         "%7CchkAddDigit%3Atrue%7CchkAddWeb%3Afalse%7CchkAddAppr%3Afalse%7CchkAddInv%3Afalse%7" +
                                         "CchkAddReseller%3Afalse%7CddlPattern1%3A%7CddlPattern2%3A%7CddlPattern3%3A%7CddlPattern4" +
                                         "%3A%7CchkSaleOffer%3Afalse%7CchkSalePublic%3Atrue%7CchkSaleExpired%3Afalse%7CchkSaleCloseouts" +
                                         "%3Afalse%7CchkSaleUsed%3Afalse%7CchkSaleBuyNow%3Afalse%7CchkSaleDC%3Afalse%7CchkAddOnSale" +
                                         "%3Afalse%7CddlAdvBids%3A0%7CtxtBids%3A%7CtxtAuctionID%3A%7CddlDateOffset%3A%7CddlRecordsPerPageAdv" +
                                         "%3A3&hidADVAction=p_&txtKeywordContext=&ddlRowsToReturn=3&hidAction=&hidItemsAddedToCart=" +
                                         "&hidGetMemberInfo=&hidShopperId=46311038&hidValidatedMemberInfo=&hidCheckedDomains=&hidMS90483566" +
                                         "=O&hidMS86848023=O&hidMS70107049=O&hidMS91154790=O&hidMS39351987=O&hidMS94284110=O&hidMS53775077=" +
                                         "O&hidMS75408187=O&hidMS94899096=B&hidMS94899097=B&hidMS94899098=B&hidMS94899099=B&hidMS94937468=" +
                                         "B&hidMS95047168=B&hidMS{0}=B&hid_Agree1=on", auction.AuctionRef);

                using (var ds = new ASEntities())
                {
                    var item = new AuctionHistory
                    {
                        HistoryID = Guid.NewGuid(),
                        Text = "Bid Process Completed",
                        CreatedDate = GetPacificTime,
                        AuctionLink = auction.AuctionID
                    };

                    ds.AuctionHistory.Add(item);
                    ds.SaveChanges();
                }
                var hdoc = HtmlDocument(Post(url, postData));
                bool confirmed = false;
                foreach (var items in QuerySelectorAll(hdoc.DocumentNode, "tr"))
                {
                    if (items.InnerHtml.Contains(auction.AuctionRef) && items.InnerHtml.Contains("the high bidder"))
                    {
                        confirmed = true;
                        using (var ds = new ASEntities())
                        {
                            var item = new AuctionHistory
                            {
                                HistoryID = Guid.NewGuid(),
                                Text = "Bid Confirmed - You are the high bidder!",
                                CreatedDate = GetPacificTime,
                                AuctionLink = auction.AuctionID
                            };

                            ds.AuctionHistory.Add(item);
                            ds.SaveChanges();
                        }
                        break;
                    }
                    if (items.InnerHtml.Contains(auction.AuctionRef) && items.InnerHtml.Contains("ERROR: Not an auction"))
                    {
                        confirmed = true;
                        using (var ds = new ASEntities())
                        {
                            var item = new AuctionHistory
                            {
                                HistoryID = Guid.NewGuid(),
                                Text = "Bid Failed - The site is no longer an auction",
                                CreatedDate = GetPacificTime,
                                AuctionLink = auction.AuctionID
                            };

                            ds.AuctionHistory.Add(item);
                            ds.SaveChanges();
                        }
                        break;
                    }

                }
                if (!confirmed)
                {
                    using (var ds = new ASEntities())
                    {
                        try
                        {
                            var content = hdoc.DocumentNode.InnerHtml;
                            new Error().Add(content);
                        }
                        catch (Exception)
                        {

                        }
                        var item = new AuctionHistory
                        {
                            HistoryID = Guid.NewGuid(),
                            Text = "Bid Not Confirmed - Data logged",
                            CreatedDate = GetPacificTime,
                            AuctionLink = auction.AuctionID
                        };

                        ds.AuctionHistory.Add(item);
                        ds.SaveChanges();
                    }
                }
            }
            else
            {
                using (var ds = new ASEntities())
                {
                    if (CaptchaOverload)
                    {
                        var item = new AuctionHistory
                        {
                            HistoryID = Guid.NewGuid(),
                            Text = "Appologies - 3rd party capture solve failure. This has been reported.",
                            CreatedDate = GetPacificTime,
                            AuctionLink = auction.AuctionID
                        };

                        ds.AuctionHistory.Add(item);
                    }
                    else
                    {
                        var item = new AuctionHistory
                        {
                            HistoryID = Guid.NewGuid(),
                            Text = "Appologies - Login to account has failed. 3 Seperate attempts made",
                            CreatedDate = GetPacificTime,
                            AuctionLink = auction.AuctionID
                        };

                        ds.AuctionHistory.Add(item);
                    }

                    //ds.GoDaddyAccount.First(x => x.AccountID == account.AccountID).Verified = false;

                    ds.SaveChanges();
                }
            }
        }
Пример #6
0
        public void PlaceBid(GoDaddyAccount account, Auctions auction)
        {
            ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
            using (var ds = new ASEntities())
            {
                var item = new AuctionHistory
                {
                    HistoryID = Guid.NewGuid(),
                    Text = "Logging In",
                    CreatedDate = GetPacificTime.AddSeconds(15),
                    AuctionLink = auction.AuctionID
                };

                ds.AuctionHistory.Add(item);
                ds.SaveChanges();
            }

            var logindata = Login(account.GoDaddyUsername, account.GoDaddyPassword);
            HttpWebRequest request;
            HttpWebResponse response;
            var responseData = "";
            var strUrl = "https://auctions.godaddy.com/trpSearchResults.aspx";

            var postData = string.Format("action=review_selected_add&items={0}_B_{1}_1|&rnd={2}&JlPYXTX=347bde7", auction.AuctionRef, auction.MyBid,
                randomDouble(0, 1).ToString("0.00000000000000000"));
            request = (HttpWebRequest)WebRequest.Create(strUrl);
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postData.Length;
            request.Accept = "text/html, application/xhtml+xml, */*";
            request.Accept = "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/x-silverlight, application/x-silverlight-2-b2, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*";
            request.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11";
            request.Headers.Add("Accept-Encoding", "deflate");
            request.Referer = "auctions.godaddy.com";
            request.Headers["my-header"] = "the-value";
            request.KeepAlive = true;
            request.CookieContainer = cookies;
            request.Timeout = Timeout.Infinite;

            using (var ds = new ASEntities())
            {
                var item = new AuctionHistory
                {
                    HistoryID = Guid.NewGuid(),
                    Text = "Setting Max Bid: " + auction.MyBid,
                    CreatedDate = GetPacificTime.AddSeconds(15),
                    AuctionLink = auction.AuctionID
                };

                ds.AuctionHistory.Add(item);
                ds.SaveChanges();
            }

            var stOut = new StreamWriter(request.GetRequestStream());
            stOut.Write(postData);
            stOut.Flush();
            stOut.Close();
            stOut = null;

            response = (HttpWebResponse)request.GetResponse();
            response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);
            var encoding = new System.Text.UTF8Encoding();
            var responseReader = new StreamReader(response.GetResponseStream(), encoding, true);

            encoding = new System.Text.UTF8Encoding();
            responseReader = new StreamReader(response.GetResponseStream(), encoding, true);

            responseData = responseReader.ReadToEnd();
            response.Close();
            responseReader.Close();

            foreach (Cookie ck in response.Cookies)
            {
                request.CookieContainer.Add(ck);
            }

            strUrl = "https://auctions.godaddy.com/trpMessageHandler.aspx";
            postData = "q=ReviewDomains";
            request = (HttpWebRequest)WebRequest.Create(strUrl);
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postData.Length;
            request.Accept = "text/html, application/xhtml+xml, */*";
            request.Accept = "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/x-silverlight, application/x-silverlight-2-b2, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*";
            request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
            request.Headers.Add("Accept-Encoding", "deflate");
            request.Referer = "auctions.godaddy.com";
            request.Headers["my-header"] = "the-value";
            request.KeepAlive = true;
            request.CookieContainer = cookies;
            request.Timeout = Timeout.Infinite;
            request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;

            stOut = new StreamWriter(request.GetRequestStream());
            stOut.Write(postData);
            stOut.Flush();
            stOut.Close();
            stOut = null;

            response = (HttpWebResponse)request.GetResponse();
            response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);

            encoding = new System.Text.UTF8Encoding();
            responseReader = new StreamReader(response.GetResponseStream(), encoding, true);

            responseData = responseReader.ReadToEnd();
            response.Close();
            responseReader.Close();

            foreach (Cookie ck in response.Cookies)
            {
                request.CookieContainer.Add(ck);
            }

            strUrl = "https://auctions.godaddy.com/trpMessageHandler.aspx?keepAlive=1";
            postData = "";
            request = (HttpWebRequest)WebRequest.Create(strUrl);
            request.Method = "GET";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postData.Length;
            request.CookieContainer = cookies;
            request.Referer = "https://auctions.godaddy.com/?t=22";
            request.Timeout = System.Threading.Timeout.Infinite;
            request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
            request.Headers.Add("Accept-Encoding", "");
            request.KeepAlive = true;

            response = (HttpWebResponse)request.GetResponse();
            response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);
            encoding = new System.Text.UTF8Encoding();
            responseReader = new StreamReader(response.GetResponseStream(), encoding, true);

            responseData = responseReader.ReadToEnd();
            response.Close();
            responseReader.Close();
            foreach (Cookie ck in response.Cookies)
            {
                request.CookieContainer.Add(ck);
            }

            strUrl = "https://idp.godaddy.com/KeepAlive.aspx?SPKey=GDDNAEB003";
            postData = "";
            request = (HttpWebRequest)WebRequest.Create(strUrl);
            request.Method = "GET";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postData.Length;
            request.CookieContainer = cookies;
            request.Referer = "https://auctions.godaddy.com/?t=22";
            request.Timeout = System.Threading.Timeout.Infinite;
            request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
            request.Headers.Add("Accept-Encoding", "");
            request.KeepAlive = true;

            response = (HttpWebResponse)request.GetResponse();
            response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);
            encoding = new System.Text.UTF8Encoding();
            responseReader = new StreamReader(response.GetResponseStream(), encoding, true);

            responseData = responseReader.ReadToEnd();
            response.Close();
            responseReader.Close();
            foreach (Cookie ck in response.Cookies)
            {
                request.CookieContainer.Add(ck);
            }

            strUrl = string.Format("https://img.godaddy.com/pageevents.aspx?page_name=/trphome.aspx&ci=37022" +
                "&eventtype=click&ciimpressions=&usrin=&relativeX=659&relativeY=325&absoluteX=659&" +
                "absoluteY=1102&r={0}&comview=0", randomDouble(0, 1).ToString("0.00000000000000000"));
            postData = "";
            request = (HttpWebRequest)WebRequest.Create(strUrl);
            request.Method = "GET";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postData.Length;
            request.CookieContainer = cookies;
            request.Referer = "https://auctions.godaddy.com/?t=22";
            request.Timeout = System.Threading.Timeout.Infinite;
            request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
            request.Headers.Add("Accept-Encoding", "");
            request.KeepAlive = true;
            request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;

            response = (HttpWebResponse)request.GetResponse();
            response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);
            encoding = new System.Text.UTF8Encoding();
            responseReader = new StreamReader(response.GetResponseStream(), encoding, true);

            responseData = responseReader.ReadToEnd();
            response.Close();
            responseReader.Close();
            foreach (Cookie ck in response.Cookies)
            {
                request.CookieContainer.Add(ck);
            }

            strUrl = @"https://auctions.godaddy.com/trpItemListingReview.aspx";
            postData = _viewstates + string.Format("&hidAdvSearch=ddlAdvKeyword%3A1%7CtxtKeyword%3Aportal" +
                "%7CddlCharacters%3A0%7CtxtCharacters%3A%7CtxtMinTraffic%3A%7CtxtMaxTraffic%3A%" +
                "7CtxtMinDomainAge%3A%7CtxtMaxDomainAge%3A%7CtxtMinPrice%3A%7CtxtMaxPrice%3A%7Cdd" +
                "lCategories%3A0%7CchkAddBuyNow%3Afalse%7CchkAddFeatured%3Afalse%7CchkAddDash%3Atrue" +
                "%7CchkAddDigit%3Atrue%7CchkAddWeb%3Afalse%7CchkAddAppr%3Afalse%7CchkAddInv%3Afalse%7" +
                "CchkAddReseller%3Afalse%7CddlPattern1%3A%7CddlPattern2%3A%7CddlPattern3%3A%7CddlPattern4" +
                "%3A%7CchkSaleOffer%3Afalse%7CchkSalePublic%3Atrue%7CchkSaleExpired%3Afalse%7CchkSaleCloseouts" +
                "%3Afalse%7CchkSaleUsed%3Afalse%7CchkSaleBuyNow%3Afalse%7CchkSaleDC%3Afalse%7CchkAddOnSale" +
                "%3Afalse%7CddlAdvBids%3A0%7CtxtBids%3A%7CtxtAuctionID%3A%7CddlDateOffset%3A%7CddlRecordsPerPageAdv" +
                "%3A3&hidADVAction=p_&txtKeywordContext=&ddlRowsToReturn=3&hidAction=&hidItemsAddedToCart=" +
                "&hidGetMemberInfo=&hidShopperId=46311038&hidValidatedMemberInfo=&hidCheckedDomains=&hidMS90483566" +
                "=O&hidMS86848023=O&hidMS70107049=O&hidMS91154790=O&hidMS39351987=O&hidMS94284110=O&hidMS53775077=" +
                "O&hidMS75408187=O&hidMS94899096=B&hidMS94899097=B&hidMS94899098=B&hidMS94899099=B&hidMS94937468=" +
                "B&hidMS95047168=B&hidMS{0}=B&hid_Agree1=on", auction.AuctionRef);
            request = (HttpWebRequest)WebRequest.Create(strUrl);
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postData.Length;
            request.Accept = "text/html, application/xhtml+xml, */*";
            request.Accept = "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/x-silverlight, application/x-silverlight-2-b2, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*";
            request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
            request.Headers.Add("Accept-Encoding", "deflate");
            request.Referer = "auctions.godaddy.com";
            request.Headers["my-header"] = "the-value";
            request.KeepAlive = true;
            request.CookieContainer = cookies;
            request.Timeout = Timeout.Infinite;

            stOut = new StreamWriter(request.GetRequestStream());
            stOut.Write(postData);
            stOut.Flush();
            stOut.Close();
            stOut = null;

            response = (HttpWebResponse)request.GetResponse();
            response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);

            encoding = new System.Text.UTF8Encoding();
            responseReader = new StreamReader(response.GetResponseStream(), encoding, true);

            responseData = responseReader.ReadToEnd();
            response.Close();
            responseReader.Close();
            using (var ds = new ASEntities())
            {
                var item = new AuctionHistory
                {
                    HistoryID = Guid.NewGuid(),
                    Text = "Bid Process Completed",
                    CreatedDate = GetPacificTime.AddSeconds(15),
                    AuctionLink = auction.AuctionID
                };

                ds.AuctionHistory.Add(item);
                ds.SaveChanges();
            }
        }
Пример #7
0
 public IQueryable<BackOrders> GetBackOrders(GoDaddyAccount account)
 {
     return Ds.BackOrders.Where(x=>x.GoDaddyAccount == account.AccountID).ToList().AsQueryable();
 }
        protected void btnSave_Godaddy(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                using (var ds = new ASEntities())
                {
                    if (GdAccount == null)
                    {
                        var account = new GoDaddyAccount
                        {
                            GoDaddyUsername = inputEmail3.Text,
                            GoDaddyPassword = inputPassword3.Text,
                            UserID = Account.UserID
                        };
                        ds.GoDaddyAccount.Add(account);
                        ds.SaveChanges();
                    }

                }
            }
        }
Пример #9
0
 public void SaveGodaddyAccount(GoDaddyAccount account)
 {
     Ds.GoDaddyAccount.AddOrUpdate(account);
     Ds.SaveChanges();
 }
Пример #10
0
 public string GetMyBidCount(GoDaddyAccount account)
 {
     return Ds.Auctions.Where(x => x.AccountID == account.AccountID).ToList().Count.ToString();
 }