Skip to content

Commit

Permalink
fixed bug when checking for line breaks on unix
Browse files Browse the repository at this point in the history
  • Loading branch information
Natured authored and Natured committed Nov 24, 2021
1 parent e1da7c7 commit 45e40a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Modules/TokenModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ public async Task GetPriceAsync()
var pageDelay = _configurationService.ConfigFile.PageDelay;

var graphFileName = "";
var poocoinWebDriver = new PoocoinWebDriver(browserEngineType);
var dexGuruRestApi = new DexGuruRestApi(_logService, dexGuruApiKey);
var binanceRestApi = new BinanceRestApi(_logService);
var poocoinWebDriver = new PoocoinWebDriver(browserEngineType);

try
{
var loadTask = poocoinWebDriver.LoadAsync(tokenAddress, TimeSpan.FromSeconds(pageDelay));
var getTokenTask = dexGuruRestApi.GetTokenAsync(tokenChain, tokenAddress);
var getTickerPriceTask = binanceRestApi.GetTickerPriceAsync("BNBBUSD");
var loadTask = poocoinWebDriver.LoadAsync(tokenAddress, TimeSpan.FromSeconds(pageDelay));

await Task.WhenAll(getTokenTask, getTickerPriceTask, loadTask).ConfigureAwait(false);
await Task.WhenAll(loadTask, getTokenTask, getTickerPriceTask).ConfigureAwait(false);

var token = getTokenTask.Result;
var tickerPrice = getTickerPriceTask.Result;
Expand Down
4 changes: 2 additions & 2 deletions src/Services/PoocoinWebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public TokenData GetTokenData()

private static string GetTotalSupply(string fullText)
{
var startText = "Total Supply:\r\n";
var startText = $"Total Supply:{Environment.NewLine}";
var startIndex = fullText.IndexOf(startText, StringComparison.OrdinalIgnoreCase);
var endIndex = fullText.IndexOf("Market Cap:", StringComparison.OrdinalIgnoreCase);

Expand All @@ -92,7 +92,7 @@ private static string GetMarketCap(string fullText)

private static string GetLpHoldings(string fullText)
{
var startText = "LP Holdings:\r\n";
var startText = $"LP Holdings:{Environment.NewLine}";
var startIndex = fullText.IndexOf(startText, StringComparison.OrdinalIgnoreCase);
var endIndex = fullText.IndexOf("| Chart", StringComparison.OrdinalIgnoreCase);

Expand Down

0 comments on commit 45e40a8

Please sign in to comment.