Skip to content

Commit

Permalink
Merge pull request #27 from volodymyrzuyev/guiedition
Browse files Browse the repository at this point in the history
Simple webgui on 127.0.0.1:1821
  • Loading branch information
hldh214 authored Feb 26, 2024
2 parents c449502 + 76962b1 commit 9845a51
Show file tree
Hide file tree
Showing 10 changed files with 418 additions and 34 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name = "pypi"
httpx = "==0.*"
loguru = "==0.*"
tenacity = "==8.*"
flask = "==3.*"

[dev-packages]

Expand Down
186 changes: 156 additions & 30 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ The last two ratios are the ratio of the price difference. The lower the value,
obtained the discounted steam wallet balance through this transaction.

Then you can buy items from buff manually and sell them to the steamcommunity.

## Webgui
A small webgui is hosted on [127.0.0.1:1821](http://127.0.0.1:1821) (more work needed)
## Requirements

To use buff2steam, you need to have:
Expand Down Expand Up @@ -108,7 +109,8 @@ docker run -it --name buff2steam --rm -v $PWD/config.json:/app/config.json ghcr.
"accept_steam_threshold": 0.8, // acceptable maximum ratio before fetching prices (in case of Steam API ratelimit)
"min_volume": 0, // minimal number of sales in 24 hours for an item to be viable
"min_price": 500, // CNY, 500 == 5 yuan
"max_price": 30000 // CNY, 30000 == 300 yuan
"max_price": 30000, // CNY, 30000 == 300 yuan
"webgui_refresh_time": 1 // update time of webgui in seconds or false, for none
},
"buff": {
"request_interval": 4, // buff api request interval (in seconds)
Expand Down
3 changes: 3 additions & 0 deletions buff2steam/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from buff2steam import config, logger
from buff2steam.provider.buff import Buff
from buff2steam.provider.steam import Steam
from buff2steam.webgui.site import items as db_items


async def main_loop(buff, steam):
Expand Down Expand Up @@ -66,6 +67,7 @@ async def main_loop(buff, steam):
visited.add(item['id'])

logger.info(' '.join(result))
db_items.add_item(config['main']['game_appid'], market_hash_name, price_overview_data['price']/100, item["id"], buff_min_price_human, volume, current_ratio)


async def main():
Expand All @@ -87,4 +89,5 @@ async def main():


if __name__ == '__main__':
db_items.set_update_time(config['main']['webgui_refresh_time'])
asyncio.run(main())
Loading

0 comments on commit 9845a51

Please sign in to comment.