Skip to content

Commit

Permalink
add buy-used to kbb
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoestner committed Dec 20, 2024
1 parent 5b2b3f4 commit a9dbafc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions folioflex/portfolio/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,10 +853,13 @@ def get_value(
response = requests.get(url, headers=headers, proxies=proxies, cookies=cookies)
if params["intent"] == "trade-in-sell":
match = re.search(r',"value":(\d+)', response.text)
elif params["intent"] == "buy-new":
elif params["intent"] == "buy-new" or params["intent"] == "buy-used":
match = re.search(r'"price":(\d+)', response.text)
else:
logger.warning("Only 'trade-in-sell' and 'buy-new' intents are supported")
logger.warning(
"Only 'trade-in-sell', 'buy-new', and 'buy-used' intents "
"are supported"
)
return None
try:
value = int(match.group(1))
Expand Down

0 comments on commit a9dbafc

Please sign in to comment.