-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new method to get stock recommendations for any symbol
Other misc fixes
- Loading branch information
Showing
16 changed files
with
152 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace OoplesFinance.YahooFinanceAPI.Helpers; | ||
|
||
internal class RecommendationHelper : YahooJsonBase | ||
{ | ||
internal override IEnumerable<T> ParseYahooJsonData<T>(string jsonData) | ||
{ | ||
var rawRecommendData = JsonSerializer.Deserialize<RecommendData>(jsonData); | ||
|
||
return rawRecommendData != null ? (IEnumerable<T>)rawRecommendData.Finance.Results.First().RecommendedSymbols : Enumerable.Empty<T>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace OoplesFinance.YahooFinanceAPI.Models; | ||
|
||
public class RecommendFinance | ||
{ | ||
[JsonPropertyName("result")] | ||
public List<RecommendResult> Results { get; set; } = new(); | ||
|
||
[JsonPropertyName("error")] | ||
public object Error { get; set; } = new(); | ||
} | ||
|
||
public class RecommendedSymbol | ||
{ | ||
[JsonPropertyName("symbol")] | ||
public string Symbol { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("score")] | ||
public double Score { get; set; } | ||
} | ||
|
||
public class RecommendResult | ||
{ | ||
[JsonPropertyName("symbol")] | ||
public string Symbol { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("recommendedSymbols")] | ||
public List<RecommendedSymbol> RecommendedSymbols { get; set; } = new(); | ||
} | ||
|
||
public class RecommendData | ||
{ | ||
[JsonPropertyName("finance")] | ||
public RecommendFinance Finance { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
global using Xunit; | ||
global using static OoplesFinance.YahooFinanceAPI.YahooClient; | ||
global using OoplesFinance.YahooFinanceAPI.Enums; | ||
global using OoplesFinance.YahooFinanceAPI.Enums; | ||
global using FluentAssertions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters