Skip to content

Commit

Permalink
Update sellResources.py
Browse files Browse the repository at this point in the history
Sell resources fixed for ikariam version 12.1.0
  • Loading branch information
Kamusksn authored Feb 1, 2025
1 parent 98439a7 commit 55dbea1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ikabot/function/sellResources.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ def getOffers(session, my_market_city, resource_type):
}
resp = session.post(params=data)
html = json.loads(resp, strict=False)[1][1][1]
return re.findall(
r'<td class=".*?">(.*?)<br/>\((.*?)\)\s*</td>\s*<td>(.*?)</td>\s*<td><img src=".*?"\s*alt=".*?"\s*title=".*?"/></td>\s*<td style="white-space:nowrap;">(\d+)\s*<img src=".*?"\s*class=".*?"/>.*?</td>\s*<td>(\d+)</td>\s*<td><a onclick="ajaxHandlerCall\(this\.href\);return false;"\s*href="\?view=takeOffer&destinationCityId=(\d+)&',
html,

html = re.sub(r'\s+', ' ', html).strip()
html = re.findall(r'<td class="short_text80">(.*?)<br/>\((.*?)\).*?tooltip">([\d\s]+)</div>.*?<td style="white-space:nowrap;">(\d+).*?<td>(\d+)</td>.*?href="\?view=takeOffer&destinationCityId=(\d+)', html)
html = [(cityname, username, re.sub(r"\s+", "", amount), price, dist, destination_city_id) for cityname, username, amount, price, dist, destination_city_id in html]

return html
)


Expand Down

0 comments on commit 55dbea1

Please sign in to comment.