示例#1
0
        private static async Task<string> SearchItems(DateTime today)
        {
            var whereIsXur = new WhereIsXurService();
            if (!whereIsXur.IsXurWorking(today))
            {
                return string.Empty;
            }
            else
            {
                var post = await whereIsXur.SearchPost(today);
                if (post == null)
                {
                    return string.Empty;
                }

                var exotics = whereIsXur.ParseExotics(post);

                if (string.IsNullOrEmpty(exotics))
                {
                    return string.Empty;
                }
                
                return exotics;
            }
        }
示例#2
0
        private static async Task<string> SearchXur(DateTime today)
        {
            var whereIsXur = new WhereIsXurService();
            if (!whereIsXur.IsXurWorking(today))
            {
                return "Xur is out of office right now";
            }
            else
            {
                var post = await whereIsXur.SearchPost(today);
                if (post == null)
                {
                    return "Searching for Xur...\nCome back in a couple of minutes.";
                }

                var location = whereIsXur.ParseLocation(post);
                if (string.IsNullOrEmpty(location))
                {
                    return "Something gone wrong with the search :(";
                }

                return location;
            }
        }