Failing to retrieve current GRC price
Closed this issue · 2 comments
Debug log has entries of "ERROR:root:Error getting info from goingecko" on all my RPis. Current price on coingecho is 0.021 and FTM shows 0.019.
# Get price from coingecko
url = 'https://www.coingecko.com/en/coins/gridcoin-research'
regex = re.compile('(Current price of Gridcoin is USD \$)(\d*\.\d*)( with)')
resp = ''
Looking at the page source of the above URL I can find no match to the regex. Perhaps they changed the wording on the page?
Not sure where you are pulling the text from for the regex but the page source does have the following script block that may be more suitable to match on:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "ExchangeRateSpecification",
"url": "https://www.coingecko.com/en/coins/gridcoin-research",
"name": "Gridcoin",
"currency": "GRC",
"currentExchangeRate": { "@type":"UnitPriceSpecification",
"price": 0.021472964359219,
"priceCurrency": "USD"
}}
</script>
Not sure though as I'm not familiar with how much this page changes.
Yeah looks like they changed their format. I pushed a fix for this, thank you for the heads up! So you know for the future, it checks several sites so if one site is down it should be fine in terms of functionality, I figured the regexes would need to be updated from time to time. And it only matters if you are controlling mining based on profitability, otherwise it will just output weird $/hr estimates if it doesn't have a price.