Tighten up some exceptions in the log
Some checks failed
Build .NET Project / build (push) Has been cancelled
Some checks failed
Build .NET Project / build (push) Has been cancelled
This commit is contained in:
@@ -239,6 +239,7 @@ namespace MarketData.Helper
|
||||
responseString = Utility.KeepAfter(responseString, "earnings_announcements_earnings_table");
|
||||
if (null == responseString) return null;
|
||||
responseString = Utility.KeepBefore(responseString, "] ]");
|
||||
responseString = Utility.RemoveAfter(responseString, "earnings_announcements_sales_table"); // so don't bleed into next table
|
||||
if (null == responseString) return null;
|
||||
responseString = responseString + "]";
|
||||
responseString = Utility.KeepAfter(responseString, "[ [");
|
||||
@@ -264,7 +265,7 @@ namespace MarketData.Helper
|
||||
if (null != periodEndingItems && 2 == periodEndingItems.Length)
|
||||
{
|
||||
int month = (int)FeedParser.ParseValueLong(periodEndingItems[0]);
|
||||
int year = (int)FeedParser.ParseValueLong(periodEndingItems[1]);
|
||||
int year = (int)FeedParser.ParseValueLong(periodEndingItems[1]);
|
||||
earningsAnnouncement.PeriodEnding = new DateTime(year, month, DateTime.DaysInMonth(year, month));
|
||||
}
|
||||
earningsAnnouncement.Estimate = FeedParser.ParseValue(columnData[2]);
|
||||
@@ -1537,7 +1538,6 @@ namespace MarketData.Helper
|
||||
symbol = symbol.ToUpper();
|
||||
|
||||
WebProxy webProxy = HttpNetRequest.GetProxy("GetCompanyProfileYahoo");
|
||||
// sb.Append("http://finance.yahoo.com/q/pr?s=").Append(symbol).Append("+Profile");
|
||||
sb.Append("https://finance.yahoo.com/quote/").Append(symbol).Append("/profile/");
|
||||
strRequest = sb.ToString();
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,strRequest);
|
||||
@@ -1628,8 +1628,12 @@ namespace MarketData.Helper
|
||||
|
||||
// parse inner JSON
|
||||
JObject inner = Newtonsoft.Json.Linq.JObject.Parse(bodyJson);
|
||||
|
||||
return inner["quoteSummary"]?["result"]?[0]?["assetProfile"]?["longBusinessSummary"]?.ToString();
|
||||
JToken resultToken = inner["quoteSummary"]?["result"]; // Ensure result is an array with at least one element
|
||||
if (resultToken is not JArray resultArray || resultArray.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return resultArray[0]?["assetProfile"]?["longBusinessSummary"]?.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user