Compare commits
5 Commits
v1.0
...
fa8bdc0e1f
Author | SHA1 | Date | |
---|---|---|---|
fa8bdc0e1f | |||
b9a7d85674 | |||
fe1c6984b2 | |||
e7ef1d4613 | |||
85a756dcab |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -152,3 +152,4 @@ cython_debug/
|
|||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
.vscode
|
@@ -1,4 +1,6 @@
|
|||||||
# BWTAqua
|
# BWTAqua
|
||||||
|
[](https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
Simple yet helpful bot to check BWT Aqua's card balance
|
Simple yet helpful bot to check BWT Aqua's card balance
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@@ -15,6 +17,7 @@ Simple yet helpful bot to check BWT Aqua's card balance
|
|||||||
3. Install PageSaver:
|
3. Install PageSaver:
|
||||||
1. `cd PageSaver`
|
1. `cd PageSaver`
|
||||||
2. `npm install`
|
2. `npm install`
|
||||||
|
3. `chmod +x pageSaver` (If you want to use compiled page saver)
|
||||||
4. Configure the bot:
|
4. Configure the bot:
|
||||||
1. `cd ..`
|
1. `cd ..`
|
||||||
2. `nano config.json` (You can use any other text editor actually, for example `vim`)
|
2. `nano config.json` (You can use any other text editor actually, for example `vim`)
|
||||||
@@ -22,5 +25,5 @@ Simple yet helpful bot to check BWT Aqua's card balance
|
|||||||
* `python3 bwtbot.py`
|
* `python3 bwtbot.py`
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
You can edit with vim, nano, on Windows it's Notepad or Notepad++. Whatever.
|
You can edit with vim, nano, whatever.
|
||||||
If you don't know where to find bot_token and your id - here you can find some hints: [get bot token](https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token), [get your id](https://www.alphr.com/telegram-find-user-id/), [get api_hash and api_id](https://core.telegram.org/api/obtaining_api_id).
|
If you don't know where to find bot_token and your id - here you can find some hints: [get bot token](https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token), [get your id](https://www.alphr.com/telegram-find-user-id/), [get api_hash and api_id](https://core.telegram.org/api/obtaining_api_id).
|
@@ -4,5 +4,6 @@
|
|||||||
"api_id": 0,
|
"api_id": 0,
|
||||||
"api_hash": "",
|
"api_hash": "",
|
||||||
"bot_token": "",
|
"bot_token": "",
|
||||||
"bot_name": ""
|
"bot_name": "",
|
||||||
|
"use_compiled_page_saver": false
|
||||||
}
|
}
|
@@ -1,3 +1,5 @@
|
|||||||
|
#-*- coding: utf-8 -*-
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
@@ -17,7 +17,11 @@ async def getWaterLeft(cardid, filename, app=None):
|
|||||||
try:
|
try:
|
||||||
|
|
||||||
os.system(f'touch data/pages/{str(filename)}.html')
|
os.system(f'touch data/pages/{str(filename)}.html')
|
||||||
os.system(f'PageSaver/pageSaver "https://bwtaqua.com.ua/card-topup/?id={cardid}" > data/pages/{str(filename)}.html')
|
|
||||||
|
if config["use_compiled_page_saver"]:
|
||||||
|
os.system(f'PageSaver/pageSaver "https://bwtaqua.com.ua/card-topup/?id={cardid}" > data/pages/{str(filename)}.html')
|
||||||
|
else:
|
||||||
|
os.system(f'node ./PageSaver/pageSaver.js "https://bwtaqua.com.ua/card-topup/?id={cardid}" > data/pages/{str(filename)}.html')
|
||||||
|
|
||||||
with open(f'data/pages/{str(filename)}.html') as f:
|
with open(f'data/pages/{str(filename)}.html') as f:
|
||||||
html_file = f.read()
|
html_file = f.read()
|
||||||
|
@@ -1 +1,3 @@
|
|||||||
beautifulsoup4
|
beautifulsoup4~=4.11.1
|
||||||
|
pyrogram~=2.0.70
|
||||||
|
pathlib~=1.0.1
|
Reference in New Issue
Block a user