From a0af79eb882de2704529c9bae0e9204d2cfc2907 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Mon, 1 May 2023 16:21:22 -0700 Subject: [PATCH] comment out where to buy for now, its causing issues --- app/star_citizen.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/app/star_citizen.py b/app/star_citizen.py index 2325cf39..6b5a4b8f 100644 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -53,28 +53,29 @@ async def get_ship(ship_name): embed.add_field(name="**Role**", value=ship_role) - # ingame_price = ( - # soup.find("div", {"class": "data-buycost infobox-data infobox-col2"}) - # .find("div", {"class": "infobox-data__value"}) - # .text - # ) - - # Hideous code for "where to buy" in game - table = soup.find("span", {"id": "Buying"}).findNext( - "table", {"class": "wikitable"} + ingame_price = ( + soup.find("div", {"class": "data-buycost infobox-data infobox-col2"}) + .find("div", {"class": "infobox-data__value"}) + .text ) - locations = [x.text.replace("\n", "") for x in table.find_all("th")] - prices = [x.text.replace("\n", "") for x in table.find_all("td")] - zip_list = zip(locations, prices) + # Hideous code for "where to buy" in game + # table = soup.find("span", {"id": "Buying"}).findNext( + # "table", {"class": "wikitable"} + # ) - result = list(zip_list) - ingame_price = [x for x in result if "Unavailable" not in x] - for x in ingame_price: - ingame_price = " ".join(x) + " aUEC" + # locations = [x.text.replace("\n", "") for x in table.find_all("th")] + # prices = [x.text.replace("\n", "") for x in table.find_all("td")] + # zip_list = zip(locations, prices) - if not len(ingame_price): - ingame_price = "No in-game price available" + # result = list(zip_list) + # ingame_price = [x for x in result if "Unavailable" not in x] + + # for x in ingame_price: + # ingame_price = " ".join(x) + " aUEC" + + # if not len(ingame_price): + # ingame_price = "No in-game price available" embed.add_field(name="**Ingame Price**", value=ingame_price, inline=True) pledge_price = (