Poll a Yiimp pool block found result page (usually on /site/found_results) and post a message to Discord chat room. It also feature a currency conversion to add blocks value in BTC and USDT (USD parity) using [stock.exchange] and [Cryptopia] markets API.
Single file app all written in Python 3 asyncio, it should be very easy to modify to use additionnal markets API and or different endpoints.
- Install depencencies (Python 3.5+)
sudo apt install python3-aiohttp python3-bs4 python3-html5lib
- Install script
sudo wget https://raw.githubusercontent.com/Kudaraidee/yiimp-blocks-found-to-discord/master/yiimp-blocks-found-to-discord.py -O /usr/local/bin/yiimp-blocks-found-to-discord.py
sudo chmod 0755 /usr/local/bin/yiimp-blocks-found-to-discord.py
- Register as a systemd service
sudo wget https://raw.githubusercontent.com/Kudaraidee/yiimp-blocks-found-to-discord/master/systemd/service -O /etc/systemd/system/yiimp-blocks-found-to-discord.service
sudo wget https://raw.githubusercontent.com/Kudaraidee/yiimp-blocks-found-to-discord/master/systemd/default -O /etc/default/yiimp-blocks-found-to-discord
sudo systemctl daemon-reload
- Edit
/etc/default/yiimp-blocks-found-to-discord
to set the correct pool URL and Discord web hook URL
Add ?algo=all
to the found pool URL after patching YIIMP, see information below, for example:
https://pool.evepool.pw/site/found_results?algo=all
- Mark as autostart and start it
sudo systemctl enable yiimp-blocks-found-to-discord
sudo systemctl start yiimp-blocks-found-to-discord
- Check application logs
sudo tail -n 50 -f /var/log/syslog | grep yiimp-blocks-found-to-discord
[poll_yiimp_events ] Exception occurred: AttributeError: __aexit__
Traceback (most recent call last):
File "/usr/local/bin/yiimp-blocks-found-to-discord.py", line 109, in poll_yiimp_events
async with aiohttp.ClientSession() as session:
AttributeError: __aexit__
If you see theses errors, you are using and old python3-aiohttp which is not compatible with current version. Please get the file from the old-aiohttp-compat-branch instead.
You will need a very small patch on your YIIMP installation: https://github.com/tpruvot/yiimp/pull/256/files
To make thing easier, I suggest you just overwrite found_results.php file with the one from here: https://raw.githubusercontent.com/Kudaraidee/yiimp/found-results-algo-filter-as-query-param/web/yaamp/modules/site/results/found_results.php