Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple webgui on 127.0.0.1:1821 #27

Merged
merged 9 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading