Пример #1
0
        /// <summary>
        ///     Returns a best guess price of one or multiple items.
        /// </summary>
        /// <param name="options">Valid options: Items, Regions, DayLimit</param>
        /// <returns>A best guess price of one or multiple items.</returns>
        public Task <EmdResponse <ItemHistory> > GetItemHistoryAsync(EmdOptions options)
        {
            Contract.Requires(options != null, "Options cannot be null.");
            string relUri     = "/api/item_history2." + Format.ToString().ToLower();
            string postString = getItemHistoryQueryString(options);

            return(requestAsync <ItemHistory>(relUri, postString));
        }
Пример #2
0
        /// <summary>
        ///     Returns the daily station rank in a region and order statistics for stations.
        /// </summary>
        /// <param name="options">Valid options: Stations, Solarsystems, Regions, DayLimit</param>
        /// <returns>The daily station rank in a region and order statistics for stations</returns>
        public Task <EmdResponse <StationRank> > GetStationRankAsync(EmdOptions options)
        {
            Contract.Requires(options != null, "Options cannot be null.");
            string relUri     = "/api/station_rank2." + Format.ToString().ToLower();
            string postString = getStationRankQueryString(options);

            return(requestAsync <StationRank>(relUri, postString));
        }
Пример #3
0
 public EveMarketData_Tests() {
     _api = new EveMarketData();
     _validOptions = new EmdOptions();
     _validOptions.Items.Add(TypeId);
     _validOptions.Regions.Add(RegionId);
     _validOptions.AgeSpan = TimeSpan.FromDays(5);
     _invalidOptions = new EmdOptions();
 }
Пример #4
0
        /// <summary>
        ///     Returns a list of any orders that were recently updated.
        /// </summary>
        /// <param name="options">Valid options: Items, Marketgroups, Regions, Date, RowLimit</param>
        /// <param name="type"></param>
        /// <returns>A list of any orders that were recently updated.</returns>
        /// <exception cref="EveLibWebException">The request was invalid.</exception>
        public Task <EmdResponse <RecentUploads> > GetRecentUploadsAsync(EmdOptions options,
                                                                         UploadType type)
        {
            Contract.Requires(options != null, "Options cannot be null.");
            string relUri     = "/api/recent_uploads2." + Format.ToString().ToLower();
            string postString = getRecentUploadsQueryString(options, type);

            return(requestAsync <RecentUploads>(relUri, postString));
        }
Пример #5
0
        /// <summary>
        ///     Returns market history for one or more items.
        /// </summary>
        /// <param name="options">Valid options: Items, Regions, DayLimit</param>
        /// <param name="type"></param>
        /// <returns>Market history for one or more items.</returns>
        public Task <EmdResponse <ItemOrders> > GetItemOrdersAsync(EmdOptions options,
                                                                   OrderType type)
        {
            Contract.Requires(options != null, "Options cannot be null.");
            string relUri     = "/api/item_orders2." + Format.ToString().ToLower();
            string postString = getItemOrdersQueryString(options, type);

            return(requestAsync <ItemOrders>(relUri, postString));
        }
Пример #6
0
        /// <summary>
        ///     Returns all the orders on the market.
        /// </summary>
        /// <param name="options">Valid options: Items, Marketgroups, Regions, Solarsystems, Stations</param>
        /// <param name="type"></param>
        /// <param name="minmax"></param>
        /// <returns>All orders on the market.</returns>
        public Task <EmdResponse <ItemPrices> > GetItemPriceAsync(EmdOptions options, OrderType type,
                                                                  MinMax minmax = default(MinMax))
        {
            Contract.Requires(options != null, "Options cannot be null.");
            string relUri     = "/api/item_prices2." + Format.ToString().ToLower();
            string postString = getItemPriceQueryString(options, type, minmax);

            return(requestAsync <ItemPrices>(relUri, postString));
        }
Пример #7
0
        private string getItemHistoryQueryString(EmdOptions options)
        {
            Contract.Requires(options != null, "Options cannot be null.");
            Contract.Requires(options.Items.Count != 0, "You must specify atleast one type.");
            Contract.Requires(options.Regions.Count != 0, "You must specify atleast one region.");
            string items   = String.Join(",", options.Items);
            string regions = String.Join(",", options.Regions);
            string days    = "" + (int)options.AgeSpan.GetValueOrDefault().TotalDays;

            return(generateQueryString("char_name", Name, "type_ids", items, "region_ids", regions, "days", days));
        }
Пример #8
0
        /// <summary>
        ///     Returns a url to a list of ingame item links. Reqiured use of the ingame browser.
        /// </summary>
        /// <param name="options">Valid options: Items, ItemGroups</param>
        /// <returns></returns>
        public Uri GetScannerUri(EmdOptions options)
        {
            // TODO Add support for return url and loop
            Contract.Requires(options != null, "Options cannot be null.");
            Contract.Requires(options.Items.Count != 0 || options.ItemGroups.Count != 0);
            const string relUri = "/update_market.php?step=Custom&";
            string       items  = String.Join(",", options.Items);
            string       groups = String.Join(",", options.ItemGroups);
            string       query  = generateQueryString("type_id", items, "marketgroup_id", groups);

            return(new Uri("http://eve-marketdata.com" + relUri + query));
        }
Пример #9
0
        private string getStationRankQueryString(EmdOptions options)
        {
            Contract.Requires(options != null, "Options cannot be null.");
            Contract.Requires(
                options.Regions.Count != 0 ^ options.Solarsystems.Count != 0 ^ options.Stations.Count != 0,
                "You must specify atleast one of the following: Station, Solarsystem, Region.");
            string regions      = String.Join(",", options.Regions);
            string solarsystems = String.Join(",", options.Solarsystems);
            string stations     = String.Join(",", options.Stations);
            string days         = "" + (int)options.AgeSpan.GetValueOrDefault().TotalDays;

            return(generateQueryString("char_name", Name, "region_ids", regions, "solarsystem_ids",
                                       solarsystems, "station_ids", stations, "days", days));
        }
Пример #10
0
        private string getRecentUploadsQueryString(EmdOptions options, UploadType type)
        {
            Contract.Requires(options != null, "Options cannot be null.");
            Contract.Requires(options.Items != null);
            Contract.Requires(options.ItemGroups != null);
            Contract.Requires(options.Regions != null);
            string items   = String.Join(",", options.Items);
            string groups  = String.Join(",", options.ItemGroups);
            string regions = String.Join(",", options.Regions);
            string date    = options.GetAgeLimit();

            return(generateQueryString("char_name", Name, "type_ids", items, "region_ids", regions,
                                       "marketgroup_ids", groups,
                                       "limit", options.RowLimit, "upload_type", options.UploadTypeToString(type), "date", date));
        }
Пример #11
0
        private string getItemOrdersQueryString(EmdOptions options, OrderType type)
        {
            Contract.Requires(options != null, "Options cannot be null.");
            Contract.Requires(options.Stations != null);
            Contract.Requires(options.Items != null);
            Contract.Requires(options.ItemGroups != null);
            Contract.Requires(options.Regions != null);
            Contract.Requires(options.Solarsystems != null);
            string items        = String.Join(",", options.Items);
            string groups       = String.Join(",", options.ItemGroups);
            string regions      = String.Join(",", options.Regions);
            string solarsystems = String.Join(",", options.Solarsystems);
            string stations     = String.Join(",", options.Stations);

            return(generateQueryString("char_name", Name, "type_ids", items, "marketgroup_ids", groups,
                                       "region_ids", regions,
                                       "solarsystem_ids", solarsystems, "station_ids", stations, "buysell", options.OrderTypeToString(type)));
        }
Пример #12
0
        private string getItemPriceQueryString(EmdOptions options, OrderType type,
                                               MinMax minmax = default(MinMax))
        {
            Contract.Requires(options != null, "Options cannot be null.");
            Contract.Requires(options.Stations != null);
            Contract.Requires(options.Items != null);
            Contract.Requires(options.ItemGroups != null);
            Contract.Requires(options.Regions != null);
            Contract.Requires(options.Solarsystems != null);
            string items        = String.Join(",", options.Items);
            string groups       = String.Join(",", options.ItemGroups);
            string regions      = String.Join(",", options.Regions);
            string solarsystems = String.Join(",", options.Solarsystems);
            string stations     = String.Join(",", options.Stations);
            string minmaxval    = minmax == MinMax.None ? "" : minmax.ToString().ToLower();

            return(generateQueryString("char_name", Name, "type_ids", items, "marketgroup_ids", groups,
                                       "region_ids", regions,
                                       "solarsystem_ids", solarsystems, "station_ids", stations, "buysell", options.OrderTypeToString(type),
                                       "minmax", minmaxval));
        }
Пример #13
0
 /// <summary>
 ///     Returns a list of any orders that were recently updated.
 /// </summary>
 /// <param name="options">Valid options: Items, Marketgroups, Regions, Date, RowLimit</param>
 /// <param name="type"></param>
 /// <returns>A list of any orders that were recently updated.</returns>
 /// <exception cref="EveLibWebException">The request was invalid.</exception>
 public EmdResponse <RecentUploads> GetRecentUploads(EmdOptions options, UploadType type)
 {
     Contract.Requires(options != null, "Options cannot be null.");
     return(GetRecentUploadsAsync(options, type).Result);
 }
Пример #14
0
 /// <summary>
 ///     Returns all the orders on the market.
 /// </summary>
 /// <param name="options">Valid options: Items, Marketgroups, Regions, Solarsystems, Stations</param>
 /// <param name="type"></param>
 /// <param name="minmax"></param>
 /// <returns>All orders on the market.</returns>
 public EmdResponse <ItemPrices> GetItemPrice(EmdOptions options, OrderType type,
                                              MinMax minmax = default(MinMax))
 {
     Contract.Requires(options != null, "Options cannot be null.");
     return(GetItemPriceAsync(options, type, minmax).Result);
 }
Пример #15
0
 /// <summary>
 ///     Returns market history for one or more items.
 /// </summary>
 /// <param name="options">Valid options: Items, Regions, DayLimit</param>
 /// <param name="type"></param>
 /// <returns>Market history for one or more items.</returns>
 public EmdResponse <ItemOrders> GetItemOrders(EmdOptions options, OrderType type)
 {
     Contract.Requires(options != null, "Options cannot be null.");
     return(GetItemOrdersAsync(options, type).Result);
 }
Пример #16
0
 /// <summary>
 ///     Returns the daily station rank in a region and order statistics for stations.
 /// </summary>
 /// <param name="options">Valid options: Stations, Solarsystems, Regions, DayLimit</param>
 /// <returns>The daily station rank in a region and order statistics for stations</returns>
 public EmdResponse <StationRank> GetStationRank(EmdOptions options)
 {
     Contract.Requires(options != null, "Options cannot be null.");
     return(GetStationRankAsync(options).Result);
 }
Пример #17
0
 /// <summary>
 ///     Returns a best guess price of one or multiple items.
 /// </summary>
 /// <param name="options">Valid options: Items, Regions, DayLimit</param>
 /// <returns>A best guess price of one or multiple items.</returns>
 public EmdResponse <ItemHistory> GetItemHistory(EmdOptions options)
 {
     Contract.Requires(options != null, "Options cannot be null.");
     return(GetItemHistoryAsync(options).Result);
 }