Giter Site home page Giter Site logo

snatural / yiimp-blocks-found-to-discord Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elverde/yiimp-blocks-found-to-discord

0.0 1.0 0.0 18 KB

Poll a Yiim pool block found result page and post a message to Discord chat room

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

yiimp-blocks-found-to-discord's Introduction

What it does

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.

System service installation

  1. Install depencencies (Python 3.5+)
sudo apt install python3-aiohttp python3-bs4 python3-html5lib
  1. Install script
sudo wget https://raw.githubusercontent.com/eLvErDe/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
  1. Register as a systemd service
sudo wget https://raw.githubusercontent.com/eLvErDe/yiimp-blocks-found-to-discord/master/systemd/service -O /etc/systemd/system/yiimp-blocks-found-to-discord.service 
sudo wget https://raw.githubusercontent.com/eLvErDe/yiimp-blocks-found-to-discord/master/systemd/default -O /etc/default/yiimp-blocks-found-to-discord
sudo systemctl daemon-reload
  1. 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.ionik.fr/site/found_results?algo=all

  1. Mark as autostart and start it
sudo systemctl enable yiimp-blocks-found-to-discord
sudo systemctl start yiimp-blocks-found-to-discord
  1. Check application logs
sudo tail -n 50 -f /var/log/syslog | grep yiimp-blocks-found-to-discord

Old aiohttp version

[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.

Patching YIIMP code to provide statistics for all algorithms

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/eLvErDe/yiimp/found-results-algo-filter-as-query-param/web/yaamp/modules/site/results/found_results.php

yiimp-blocks-found-to-discord's People

Contributors

elverde avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.