コード例 #1
0
        public void Get()
        {
            string url = "https://mobile.eventshopper.com/mobilewroom/?wr=07a73b4d-6e15-4926-8f53-abe29a7834ea&preFill=1&lang=en&locale=en_us&eventid=278555&ec=STC151106&src=AEGAXS1_WMAIN&skin=axs_staples&fbShareURL=m.axs.com%2Fevents%2F278555%2Fnitro-circus-live-tickets%3F%26ref%3Devs_fb";
            string wr  = "07a73b4d-6e15-4926-8f53-abe29a7834ea";

            HttpSimulator simulator = new HttpSimulator();
            string        respose   = simulator.Get(url);

            string lot = simulator.GetData(respose, "var lotId = \"", "\";", System.Text.RegularExpressions.RegexOptions.None);

            string xmlData = string.Format("<?xml version=\"1.0\"?><methodCall><methodName>getPhase</methodName><params><param><value><string>{0}</string></value></param><param><value><string>{1}</string></value></param></params></methodCall>", wr, lot);

            string xmlResponse = simulator.PostFormUrlEncoded(string.Format("https://tickets.axs.com/xmlrpc/?methodName=getPhase&lotId={0}&wr={1}", lot, wr), xmlData);

            string hash = GetXmlNodeValue(xmlResponse.Replace("<?xml version=\"1.0\"?>", string.Empty), "hash");
            string ts   = GetXmlNodeValue(xmlResponse.Replace("<?xml version=\"1.0\"?>", string.Empty), "hashts");

            string newUrl = string.Format("{0}&lot={1}&hash={2}&ts={3}", url.Replace("mobilewroom", "mobileshopper"), lot, hash, ts);

            simulator.Get(newUrl);

            string res = simulator.PostPlainText("https://mobile.eventshopper.com/mobileshopper/ajax/availWSS.json", string.Format("[\"{0}\"]", wr));
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: riskypathak/Axs
        private bool AreTicketsAvailable(string url, string wr, out Dictionary <string, string> seatStatus)
        {
            HttpSimulator simulator = new HttpSimulator();
            string        respose   = simulator.Get(url);
            bool          isBlank   = false;

            string lot = simulator.GetData(respose, "var lotId = \"", "\";", System.Text.RegularExpressions.RegexOptions.None);

            string xmlData = string.Format("<?xml version=\"1.0\"?><methodCall><methodName>getPhase</methodName><params><param><value><string>{0}</string></value></param><param><value><string>{1}</string></value></param></params></methodCall>", wr, lot);

            string xmlResponse = simulator.PostFormUrlEncoded(string.Format("https://tickets.axs.com/xmlrpc/?methodName=getPhase&lotId={0}&wr={1}", lot, wr), xmlData);

            string hash = GetXmlNodeValue(xmlResponse.Replace("<?xml version=\"1.0\"?>", string.Empty), "hash");
            string ts   = GetXmlNodeValue(xmlResponse.Replace("<?xml version=\"1.0\"?>", string.Empty), "hashts");

            string newUrl = string.Format("{0}&lot={1}&hash={2}&ts={3}", url.Replace("mobilewroom", "mobileshopper"), lot, hash, ts);

            string mobileShopperResponse = simulator.Get(newUrl);


            string jsonResponse = simulator.PostPlainText("https://mobile.eventshopper.com/mobileshopper/ajax/availWSS.json", string.Format("[\"{0}\"]", wr));

            isBlank = isEmpty(jsonResponse);



            if (!isBlank)
            {
                seatStatus = GetSeatStatus(simulator, jsonResponse, mobileShopperResponse, wr);
            }
            else
            {
                seatStatus = null;
            }

            return(isBlank);
        }