add 2024 support

This commit is contained in:
2024-02-15 10:50:39 -06:00
parent 7e0a91805f
commit e085b0802e

View File

@ -11,8 +11,11 @@ if save == "csv":
writeFile("games.csv", "link,price,yearOfRelease,multiplier,reviewCount,estimatedSales,estimatedRevenue\n")
let commandLine = os.commandLineParams()
let steamURLS = commandLine[1..paramCount()-1]
var response: string
var steamURL: string
for steamURL in steamURLS:
let response = client.getContent(steamURL)
response = client.getContent(steamURL)
var html = htmlparser.parseHtml(response)
@ -63,6 +66,8 @@ for steamURL in steamURLS:
multiplier = 31
of "2023":
multiplier = 31
of "2024":
multiplier = 31
if onSale:
let steamID = steamURL.split("/")[4]
@ -172,7 +177,7 @@ echo "Estimated Sales: " & $estimatedSales
let estimatedRevenue = "$" & (((toFloat(estimatedSales)*price*0.70).formatFloat(ffDecimal, 2)).insertSep(',')).replace(",.", ".") & " (USD)"
echo "Estimated revenue (including steam cut): " & $estimatedRevenue
if save:
if save == "csv":
for name in html.findall("span"):
if name.attr("itemprop") == "name":
var output = """
@ -185,4 +190,3 @@ Estimated Sales: $6
Estimated revenue (including steam cut): $7""" % [os.paramStr(2), $price, yearOfRelease, $multiplier, $reviewCount, $estimatedSales, $estimatedRevenue]
writeFile(name.innerText, output)
>>>>>>> 3577e654b3ba336331654b056cc794678a8c2f56